enclose-io/compiler

View on GitHub
lts/doc/api/all.json

Summary

Maintainability
Test Coverage
{
  "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",
          "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/master/CONTRIBUTING.md\">the contributing guide</a> for directions on how to submit pull requests.</p>",
          "type": "misc",
          "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 indices are as follows:</p>\n<blockquote>\n<p>Stability: 0 - Deprecated. The feature may emit warnings. Backward\ncompatibility is not guaranteed.</p>\n</blockquote>\n<!-- separator -->\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</blockquote>\n<!-- separator -->\n<blockquote>\n<p>Stability: 2 - Stable. Compatibility with the npm ecosystem is a high\npriority.</p>\n</blockquote>\n<p>Use caution when making use of Experimental features, particularly within\nmodules. End users may not be aware that experimental features are being used.\nBugs or behavior changes may surprise end 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#process_event_warning\">warning</a>.</p>"
        },
        {
          "textRaw": "JSON output",
          "name": "json_output",
          "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>",
          "type": "misc",
          "displayName": "JSON output"
        },
        {
          "textRaw": "System calls and man pages",
          "name": "system_calls_and_man_pages",
          "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>",
          "type": "misc",
          "displayName": "System calls and man pages"
        }
      ]
    },
    {
      "textRaw": "C++ addons",
      "name": "C++ addons",
      "introduced_in": "v0.10.0",
      "type": "misc",
      "desc": "<p>Addons are dynamically-linked shared objects written in C++. The\n<a href=\"modules.html#modules_require_id\"><code>require()</code></a> function can load Addons as ordinary Node.js modules.\nAddons provide an interface between JavaScript and C/C++ libraries.</p>\n<p>There are three options for implementing Addons: N-API, nan, or direct\nuse of internal V8, libuv and Node.js libraries. Unless there is a need for\ndirect access to functionality which is not exposed by N-API, use N-API.\nRefer to <a href=\"n-api.html\">C/C++ Addons with N-API</a> for more information on N-API.</p>\n<p>When not using N-API, implementing Addons is complicated,\ninvolving knowledge of several components and APIs:</p>\n<ul>\n<li>\n<p>V8: the C++ library Node.js uses to provide the\nJavaScript implementation. V8 provides the mechanisms for creating objects,\ncalling functions, etc. 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), which 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\">libuv</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 filesystem, sockets, timers, and system events. libuv\nalso provides a pthreads-like threading abstraction that may be used to\npower more sophisticated asynchronous Addons that need to move beyond the\nstandard event loop. Addon authors are encouraged to think about how to\navoid blocking the event loop with I/O or other time-intensive tasks by\noff-loading work via libuv to non-blocking system operations, worker threads\nor a custom use of libuv's 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>Node.js includes 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=\"addons.html#addons_linking_to_libraries_included_with_node_js\">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",
          "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\n}  // namespace demo\n</code></pre>\n<p>All Node.js Addons must export an initialization function following\nthe pattern:</p>\n<pre><code class=\"language-cpp\">void Initialize(Local&#x3C;Object> exports);\nNODE_MODULE(NODE_GYP_MODULE_NAME, Initialize)\n</code></pre>\n<p>There is no semi-colon after <code>NODE_MODULE</code> as it's not a function (see\n<code>node.h</code>).</p>\n<p>The <code>module_name</code> must match the filename of the final binary (excluding\nthe <code>.node</code> suffix).</p>\n<p>In the <code>hello.cc</code> example, then, the initialization function is <code>Initialize</code>\nand the addon module name is <code>addon</code>.</p>\n<p>When building addons with <code>node-gyp</code>, using the macro <code>NODE_GYP_MODULE_NAME</code> as\nthe first parameter of <code>NODE_MODULE()</code> will ensure that the name of the final\nbinary will be passed to <code>NODE_MODULE()</code>.</p>",
          "modules": [
            {
              "textRaw": "Context-aware addons",
              "name": "context-aware_addons",
              "desc": "<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>. From the addon's perspective, this means\nthat it must 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>The choice to build a context-aware addon carries with it the responsibility of\ncarefully managing global static data. 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>\n<p>Define a class which will hold per-addon-instance data and which has a static\nmember of the form</p>\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 = context->GetIsolate();\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\", NewStringType::kNormal)\n                  .ToLocalChecked(),\n               FunctionTemplate::New(isolate, Method, external)\n                  ->GetFunction(context).ToLocalChecked()).FromJust();\n}\n</code></pre>",
              "modules": [
                {
                  "textRaw": "Worker support",
                  "name": "worker_support",
                  "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 N-API addon, or</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#worker_threads_class_worker\"><code>Worker</code></a> threads, addons need to clean up any resources\nthey may have allocated when such a thread exists. 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 using\n<code>RemoveEnvironmentCleanupHook()</code> before they are run, which has the same\nsignature. Callbacks are run in last-in first-out order.</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;assert.h>\n#include &#x3C;stdlib.h>\n#include &#x3C;node.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 = context->GetIsolate();\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>",
                  "type": "module",
                  "displayName": "Worker support"
                }
              ],
              "type": "module",
              "displayName": "Context-aware addons"
            },
            {
              "textRaw": "Building",
              "name": "building",
              "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\">node-gyp</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#modules_require_id\"><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>",
              "type": "module",
              "displayName": "Building"
            },
            {
              "textRaw": "Linking to libraries included with Node.js",
              "name": "linking_to_libraries_included_with_node.js",
              "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, then\nonly 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>",
              "type": "module",
              "displayName": "Linking to libraries included with Node.js"
            },
            {
              "textRaw": "Loading addons using `require()`",
              "name": "loading_addons_using_`require()`",
              "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#modules_require_id\"><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#modules_require_id\"><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#modules_require_id\"><code>require('addon')</code></a> will give precedence to the <code>addon.js</code> file\nand load it instead.</p>",
              "type": "module",
              "displayName": "Loading addons using `require()`"
            }
          ],
          "type": "misc",
          "displayName": "Hello world"
        },
        {
          "textRaw": "Native abstractions for Node.js",
          "name": "native_abstractions_for_node.js",
          "desc": "<p>Each of the examples illustrated in this document make direct use of 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/master/examples/\">examples</a> for an\nillustration of how it can be used.</p>",
          "type": "misc",
          "displayName": "Native abstractions for Node.js"
        },
        {
          "textRaw": "N-API",
          "name": "n-api",
          "stability": 2,
          "stabilityText": "Stable",
          "desc": "<p>N-API is an API for building native Addons. It is independent from\nthe underlying JavaScript runtime (e.g. V8) and is maintained as part of\nNode.js itself. This API will be Application Binary Interface (ABI) stable\nacross versions of Node.js. It is intended to insulate Addons from\nchanges in the underlying JavaScript engine and allow modules\ncompiled for one version to run on later versions of Node.js without\nrecompilation. Addons are built/packaged with the same approach/tools\noutlined in this document (node-gyp, etc.). The only difference is the\nset of APIs that are used by the native code. Instead of using the V8\nor <a href=\"https://github.com/nodejs/nan\">Native Abstractions for Node.js</a> APIs, the functions available\nin the N-API are used.</p>\n<p>Creating and maintaining an addon that benefits from the ABI stability\nprovided by N-API carries with it certain\n<a href=\"n-api.html#n_api_implications_of_abi_stability\">implementation considerations</a>.</p>\n<p>To use N-API in the above \"Hello world\" example, replace the content of\n<code>hello.cc</code> with the following. All other instructions remain the same.</p>\n<pre><code class=\"language-cpp\">// hello.cc using N-API\n#include &#x3C;node_api.h>\n\nnamespace demo {\n\nnapi_value Method(napi_env env, napi_callback_info args) {\n  napi_value greeting;\n  napi_status status;\n\n  status = napi_create_string_utf8(env, \"world\", NAPI_AUTO_LENGTH, &#x26;greeting);\n  if (status != napi_ok) return nullptr;\n  return greeting;\n}\n\nnapi_value init(napi_env env, napi_value exports) {\n  napi_status status;\n  napi_value fn;\n\n  status = napi_create_function(env, nullptr, 0, Method, nullptr, &#x26;fn);\n  if (status != napi_ok) return nullptr;\n\n  status = napi_set_named_property(env, exports, \"hello\", fn);\n  if (status != napi_ok) return nullptr;\n  return exports;\n}\n\nNAPI_MODULE(NODE_GYP_MODULE_NAME, init)\n\n}  // namespace demo\n</code></pre>\n<p>The functions available and how to use them are documented in\n<a href=\"n-api.html\">C/C++ Addons with N-API</a>.</p>",
          "type": "misc",
          "displayName": "N-API"
        },
        {
          "textRaw": "Addon examples",
          "name": "addon_examples",
          "desc": "<p>Following are some example Addons intended to help developers get started. The\nexamples make use of 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://github.com/v8/v8/wiki/Embedder&#x27;s%20Guide\">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-console\">$ node-gyp configure build\n</code></pre>",
          "modules": [
            {
              "textRaw": "Function arguments",
              "name": "function_arguments",
              "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::NewStringType;\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\",\n                            NewStringType::kNormal).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\",\n                            NewStringType::kNormal).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>",
              "type": "module",
              "displayName": "Function arguments"
            },
            {
              "textRaw": "Callbacks",
              "name": "callbacks",
              "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::NewStringType;\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\",\n                          NewStringType::kNormal).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>",
              "type": "module",
              "displayName": "Callbacks"
            },
            {
              "textRaw": "Object factory",
              "name": "object_factory",
              "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::NewStringType;\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\",\n                               NewStringType::kNormal).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>",
              "type": "module",
              "displayName": "Object factory"
            },
            {
              "textRaw": "Function factory",
              "name": "function_factory",
              "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::NewStringType;\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\", NewStringType::kNormal).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\", NewStringType::kNormal).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>",
              "type": "module",
              "displayName": "Function factory"
            },
            {
              "textRaw": "Wrapping C++ objects",
              "name": "wrapping_c++_objects",
              "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.\nBelow, the method <code>plusOne()</code> is exposed by adding it to the constructor's\nprototype:</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::NewStringType;\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 = exports->GetIsolate();\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(\n      isolate, \"MyObject\", NewStringType::kNormal).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\", NewStringType::kNormal).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).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.Holder());\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>",
              "type": "module",
              "displayName": "Wrapping C++ objects"
            },
            {
              "textRaw": "Factory of wrapped objects",
              "name": "factory_of_wrapped_objects",
              "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(exports->GetIsolate());\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(v8::Isolate* isolate);\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::NewStringType;\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(Isolate* isolate) {\n  // Prepare constructor template\n  Local&#x3C;FunctionTemplate> tpl = FunctionTemplate::New(isolate, New);\n  tpl->SetClassName(String::NewFromUtf8(\n      isolate, \"MyObject\", NewStringType::kNormal).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.Holder());\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>",
              "type": "module",
              "displayName": "Factory of wrapped objects"
            },
            {
              "textRaw": "Passing wrapped objects around",
              "name": "passing_wrapped_objects_around",
              "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(exports->GetIsolate());\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(v8::Isolate* isolate);\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> is similar to before:</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::NewStringType;\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(Isolate* isolate) {\n  // Prepare constructor template\n  Local&#x3C;FunctionTemplate> tpl = FunctionTemplate::New(isolate, New);\n  tpl->SetClassName(String::NewFromUtf8(\n      isolate, \"MyObject\", NewStringType::kNormal).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>",
              "type": "module",
              "displayName": "Passing wrapped objects around"
            }
          ],
          "type": "misc",
          "displayName": "Addon examples"
        }
      ]
    },
    {
      "textRaw": "N-API",
      "name": "N-API",
      "introduced_in": "v8.0.0",
      "type": "misc",
      "stability": 2,
      "stabilityText": "Stable",
      "desc": "<p>N-API (pronounced N as in the letter, followed by API)\nis an API for building native Addons. It is independent from\nthe underlying JavaScript runtime (for example, V8) and is maintained as part of\nNode.js itself. This API will be Application Binary Interface (ABI) stable\nacross versions of Node.js. It is intended to insulate Addons from\nchanges 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 the N-API are used.</p>\n<p>APIs exposed by N-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 N-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=\"n-api.html#n_api_error_handling\">Error handling</a>.</li>\n</ul>\n<p>The N-API is a C API that ensures ABI stability across Node.js versions\nand different compiler levels. A C++ API can be easier to use.\nTo support using C++, the project maintains a\nC++ wrapper module called <a href=\"https://github.com/nodejs/node-addon-api\">node-addon-api</a>.\nThis wrapper provides an inlineable C++ API. Binaries built\nwith <code>node-addon-api</code> will depend on the symbols for the N-API C-based\nfunctions exported by Node.js. <code>node-addon-api</code> is a more\nefficient way to write code that calls N-API. Take, for example, the\nfollowing <code>node-addon-api</code> code. The first section shows the\n<code>node-addon-api</code> code and the second section shows what actually gets\nused in the addon.</p>\n<pre><code class=\"language-cpp\">Object obj = Object::New(env);\nobj[\"foo\"] = String::New(env, \"bar\");\n</code></pre>\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. As a result,\nit still gets the benefits of the ABI stability provided by the C 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>",
      "miscs": [
        {
          "textRaw": "Implications of ABI stability",
          "name": "implications_of_abi_stability",
          "desc": "<p>Although N-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 make use exclusively of N-API 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 N-API.</p>",
          "type": "misc",
          "displayName": "Implications of ABI stability"
        },
        {
          "textRaw": "Building",
          "name": "building",
          "desc": "<p>Unlike modules written in JavaScript, developing and deploying Node.js\nnative addons using N-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 plarforms. 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 --production 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",
              "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",
                  "desc": "<p><a href=\"https://github.com/nodejs/node-gyp\">node-gyp</a> is a build system based on Google's <a href=\"https://gyp.gsrc.io\">GYP</a> tool and comes\nbundled with npm. GYP, and therefore node-gyp, requires that Python be\ninstalled.</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>",
                  "type": "module",
                  "displayName": "node-gyp"
                }
              ],
              "properties": [
                {
                  "textRaw": "CMake.js",
                  "name": "js",
                  "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.</p>"
                }
              ],
              "type": "module",
              "displayName": "Build tools"
            },
            {
              "textRaw": "Uploading precompiled binaries",
              "name": "uploading_precompiled_binaries",
              "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",
                  "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>",
                  "type": "module",
                  "displayName": "node-pre-gyp"
                },
                {
                  "textRaw": "prebuild",
                  "name": "prebuild",
                  "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>",
                  "type": "module",
                  "displayName": "prebuild"
                },
                {
                  "textRaw": "prebuildify",
                  "name": "prebuildify",
                  "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 module when it's\nuploaded to npm. The binaries are downloaded from npm and are immediately\navailable to the module user when the native module is installed.</p>",
                  "type": "module",
                  "displayName": "prebuildify"
                }
              ],
              "type": "module",
              "displayName": "Uploading precompiled binaries"
            }
          ],
          "type": "misc",
          "displayName": "Building"
        },
        {
          "textRaw": "Usage",
          "name": "usage",
          "desc": "<p>In order to use the N-API functions, include the file <a href=\"https://github.com/nodejs/node/blob/master/src/node_api.h\"><code>node_api.h</code></a> which is\nlocated 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 N-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 N-API surface to just the functionality that was available in\nthe specified (and earlier) versions.</p>\n<p>Some of the N-API surface is considered experimental and requires explicit\nopt-in to access those APIs:</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>",
          "type": "misc",
          "displayName": "Usage"
        },
        {
          "textRaw": "N-API version matrix",
          "name": "n-api_version_matrix",
          "desc": "<p>N-API versions are additive and versioned independently from Node.js.\nVersion 4 is an extension to version 3 in that it has all of the APIs\nfrom version 3 with some additions. This means that it is not necessary\nto recompile for new versions of Node.js which are\nlisted as supporting a later version.</p>\n<table>\n<thead>\n<tr>\n<th></th>\n<th>1</th>\n<th>2</th>\n<th>3</th>\n<th>4</th>\n<th>5</th>\n<th>6</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>v6.x</td>\n<td></td>\n<td></td>\n<td>v6.14.2*</td>\n<td></td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>v8.x</td>\n<td>v8.0.0*</td>\n<td>v8.10.0*</td>\n<td>v8.11.2</td>\n<td>v8.16.0</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>v9.x</td>\n<td>v9.0.0*</td>\n<td>v9.3.0*</td>\n<td>v9.11.0*</td>\n<td></td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>v10.x</td>\n<td>v10.0.0</td>\n<td>v10.0.0</td>\n<td>v10.0.0</td>\n<td>v10.16.0</td>\n<td>v10.17.0</td>\n<td>v10.20.0</td>\n</tr>\n<tr>\n<td>v11.x</td>\n<td>v11.0.0</td>\n<td>v11.0.0</td>\n<td>v11.0.0</td>\n<td>v11.8.0</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>v12.x</td>\n<td>v12.0.0</td>\n<td>v12.0.0</td>\n<td>v12.0.0</td>\n<td>v12.0.0</td>\n<td>v12.11.0</td>\n<td>v12.17.0</td>\n</tr>\n<tr>\n<td>v13.x</td>\n<td>v13.0.0</td>\n<td>v13.0.0</td>\n<td>v13.0.0</td>\n<td>v13.0.0</td>\n<td>v13.0.0</td>\n<td></td>\n</tr>\n<tr>\n<td>v14.x</td>\n<td>v14.0.0</td>\n<td>v14.0.0</td>\n<td>v14.0.0</td>\n<td>v14.0.0</td>\n<td>v14.0.0</td>\n<td>v14.0.0</td>\n</tr>\n</tbody>\n</table>\n<p>* Indicates that the N-API version was released as experimental</p>\n<p>The N-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 N-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 N-API. In the example below,\n<code>addon.c</code> and <code>addon.h</code> refer only to <code>js_native_api.h</code>. This ensures that\n<code>addon.c</code> can be reused to compile against either the Node.js implementation of\nN-API or any implementation of N-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 NAPI_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      bool is_pending;                                            \\\n      napi_is_exception_pending((env), &#x26;is_pending);              \\\n      if (!is_pending) {                                          \\\n        const char* message = (error_info->error_message == NULL) \\\n            ? \"empty error message\"                               \\\n            : error_info->error_message;                          \\\n        napi_throw_error((env), NULL, message);                   \\\n        return NULL;                                              \\\n      }                                                           \\\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  NAPI_CALL(env, napi_create_object(env, &#x26;result));\n\n  napi_value exported_function;\n  NAPI_CALL(env, napi_create_function(env,\n                                      \"doSomethingUseful\",\n                                      NAPI_AUTO_LENGTH,\n                                      DoSomethingUseful,\n                                      NULL,\n                                      &#x26;exported_function));\n\n  NAPI_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() {\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>",
          "type": "misc",
          "displayName": "N-API version matrix"
        },
        {
          "textRaw": "Environment life cycle APIs",
          "name": "environment_life_cycle_apis",
          "stability": 1,
          "stabilityText": "Experimental",
          "desc": "<p><a href=\"https://tc39.es/ecma262/#sec-agents\">Section 8.7</a> of the <a href=\"https://tc39.github.io/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 of which they make use during\ntheir entire life cycle such that the state must be unique to each instance of\nthe addon.</p>\n<p>To this end, N-API provides a way to allocate data such that its life cycle is\ntied to the life cycle of the Agent.</p>",
          "modules": [
            {
              "textRaw": "napi_set_instance_data",
              "name": "napi_set_instance_data",
              "meta": {
                "added": [
                  "v12.8.0"
                ],
                "napiVersion": [
                  6
                ],
                "changes": []
              },
              "desc": "<pre><code class=\"language-c\">napi_status napi_set_instance_data(napi_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 N-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.</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 Agent. <code>data</code> can later\nbe retrieved using <code>napi_get_instance_data()</code>. Any existing data associated with\nthe currently running Agent which was set by means of a previous call to\n<code>napi_set_instance_data()</code> will be overwritten. If a <code>finalize_cb</code> was provided\nby the previous call, it will not be called.</p>",
              "type": "module",
              "displayName": "napi_set_instance_data"
            },
            {
              "textRaw": "napi_get_instance_data",
              "name": "napi_get_instance_data",
              "meta": {
                "added": [
                  "v12.8.0"
                ],
                "napiVersion": [
                  6
                ],
                "changes": []
              },
              "desc": "<pre><code class=\"language-c\">napi_status napi_get_instance_data(napi_env env,\n                                   void** data);\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the N-API call is invoked under.</li>\n<li><code>[out] data</code>: The data item that was previously associated with the currently\nrunning Agent 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 Agent via <code>napi_set_instance_data()</code>. If no data is set, the call will\nsucceed and <code>data</code> will be set to <code>NULL</code>.</p>",
              "type": "module",
              "displayName": "napi_get_instance_data"
            }
          ],
          "type": "misc",
          "displayName": "Environment life cycle APIs"
        },
        {
          "textRaw": "Basic N-API data types",
          "name": "basic_n-api_data_types",
          "desc": "<p>N-API exposes the following fundamental datatypes as abstractions that are\nconsumed by the various APIs. These APIs should be treated as opaque,\nintrospectable only with other N-API calls.</p>",
          "modules": [
            {
              "textRaw": "napi_status",
              "name": "napi_status",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "napiVersion": [
                  1
                ],
                "changes": []
              },
              "desc": "<p>Integral status code indicating the success or failure of a N-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_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>",
              "type": "module",
              "displayName": "napi_status"
            },
            {
              "textRaw": "napi_extended_error_info",
              "name": "napi_extended_error_info",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "napiVersion": [
                  1
                ],
                "changes": []
              },
              "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 N-API status code that originated with the last error.</li>\n</ul>\n<p>See the <a href=\"n-api.html#n_api_error_handling\">Error handling</a> section for additional information.</p>",
              "type": "module",
              "displayName": "napi_extended_error_info"
            },
            {
              "textRaw": "napi_env",
              "name": "napi_env",
              "desc": "<p><code>napi_env</code> is used to represent a context that the underlying N-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 N-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 N-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#worker_threads_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=\"n-api.html#n_api_napi_add_env_cleanup_hook\"><code>napi_add_env_cleanup_hook</code></a> and\n<a href=\"n-api.html#n_api_napi_set_instance_data\"><code>napi_set_instance_data</code></a>.</p>",
              "type": "module",
              "displayName": "napi_env"
            },
            {
              "textRaw": "napi_value",
              "name": "napi_value",
              "desc": "<p>This is an opaque pointer that is used to represent a JavaScript value.</p>",
              "type": "module",
              "displayName": "napi_value"
            },
            {
              "textRaw": "napi_threadsafe_function",
              "name": "napi_threadsafe_function",
              "meta": {
                "added": [
                  "v10.6.0"
                ],
                "napiVersion": [
                  4
                ],
                "changes": []
              },
              "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>",
              "type": "module",
              "displayName": "napi_threadsafe_function"
            },
            {
              "textRaw": "napi_threadsafe_function_release_mode",
              "name": "napi_threadsafe_function_release_mode",
              "meta": {
                "added": [
                  "v10.6.0"
                ],
                "napiVersion": [
                  4
                ],
                "changes": []
              },
              "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>",
              "type": "module",
              "displayName": "napi_threadsafe_function_release_mode"
            },
            {
              "textRaw": "napi_threadsafe_function_call_mode",
              "name": "napi_threadsafe_function_call_mode",
              "meta": {
                "added": [
                  "v10.6.0"
                ],
                "napiVersion": [
                  4
                ],
                "changes": []
              },
              "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>",
              "type": "module",
              "displayName": "napi_threadsafe_function_call_mode"
            },
            {
              "textRaw": "N-API memory management types",
              "name": "n-api_memory_management_types",
              "modules": [
                {
                  "textRaw": "napi_handle_scope",
                  "name": "napi_handle_scope",
                  "desc": "<p>This is an abstraction used to control and modify the lifetime of objects\ncreated within a particular scope. In general, N-API values are created within\nthe 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, N-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=\"n-api.html#n_api_napi_open_handle_scope\"><code>napi_open_handle_scope</code></a> and are destroyed\nusing <a href=\"n-api.html#n_api_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=\"n-api.html#n_api_object_lifetime_management\">Object lifetime management</a>.</p>",
                  "type": "module",
                  "displayName": "napi_handle_scope"
                },
                {
                  "textRaw": "napi_escapable_handle_scope",
                  "name": "napi_escapable_handle_scope",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "napiVersion": [
                      1
                    ],
                    "changes": []
                  },
                  "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>",
                  "type": "module",
                  "displayName": "napi_escapable_handle_scope"
                },
                {
                  "textRaw": "napi_ref",
                  "name": "napi_ref",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "napiVersion": [
                      1
                    ],
                    "changes": []
                  },
                  "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=\"n-api.html#n_api_object_lifetime_management\">Object lifetime management</a>.</p>",
                  "type": "module",
                  "displayName": "napi_ref"
                }
              ],
              "type": "module",
              "displayName": "N-API memory management types"
            },
            {
              "textRaw": "N-API callback types",
              "name": "n-api_callback_types",
              "modules": [
                {
                  "textRaw": "napi_callback_info",
                  "name": "napi_callback_info",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "napiVersion": [
                      1
                    ],
                    "changes": []
                  },
                  "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>",
                  "type": "module",
                  "displayName": "napi_callback_info"
                },
                {
                  "textRaw": "napi_callback",
                  "name": "napi_callback",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "napiVersion": [
                      1
                    ],
                    "changes": []
                  },
                  "desc": "<p>Function pointer type for user-provided native functions which are to be\nexposed to JavaScript via N-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>",
                  "type": "module",
                  "displayName": "napi_callback"
                },
                {
                  "textRaw": "napi_finalize",
                  "name": "napi_finalize",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "napiVersion": [
                      1
                    ],
                    "changes": []
                  },
                  "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 with which it was associated with, has been garbage-collected. The user\nmust provide a function satisfying the following signature which would get\ncalled upon the object's collection. Currently, <code>napi_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 (*napi_finalize)(napi_env env,\n                              void* finalize_data,\n                              void* finalize_hint);\n</code></pre>",
                  "type": "module",
                  "displayName": "napi_finalize"
                },
                {
                  "textRaw": "napi_async_execute_callback",
                  "name": "napi_async_execute_callback",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "napiVersion": [
                      1
                    ],
                    "changes": []
                  },
                  "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 N-API calls\nthat execute JavaScript or interact with\nJavaScript objects. N-API\ncalls should be in the <code>napi_async_complete_callback</code> instead.\nDo not use the <code>napi_env</code> parameter as it will likely\nresult in execution of JavaScript.</p>",
                  "type": "module",
                  "displayName": "napi_async_execute_callback"
                },
                {
                  "textRaw": "napi_async_complete_callback",
                  "name": "napi_async_complete_callback",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "napiVersion": [
                      1
                    ],
                    "changes": []
                  },
                  "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>",
                  "type": "module",
                  "displayName": "napi_async_complete_callback"
                },
                {
                  "textRaw": "napi_threadsafe_function_call_js",
                  "name": "napi_threadsafe_function_call_js",
                  "meta": {
                    "added": [
                      "v10.6.0"
                    ],
                    "napiVersion": [
                      4
                    ],
                    "changes": []
                  },
                  "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>N-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 N-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>",
                  "type": "module",
                  "displayName": "napi_threadsafe_function_call_js"
                }
              ],
              "type": "module",
              "displayName": "N-API callback types"
            }
          ],
          "type": "misc",
          "displayName": "Basic N-API data types"
        },
        {
          "textRaw": "Error handling",
          "name": "error_handling",
          "desc": "<p>N-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",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "napiVersion": [
                  1
                ],
                "changes": []
              },
              "desc": "<p>All of the N-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=\"n-api.html#n_api_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=\"n-api.html#n_api_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>: n-api status code for the last error.</li>\n</ul>\n<p><a href=\"n-api.html#n_api_napi_get_last_error_info\"><code>napi_get_last_error_info</code></a> returns the information for the last\nN-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",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "napiVersion": [
                      1
                    ],
                    "changes": []
                  },
                  "desc": "<pre><code class=\"language-c\">napi_status\nnapi_get_last_error_info(napi_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\nan n-api function is called on the same <code>env</code>.</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>",
                  "type": "module",
                  "displayName": "napi_get_last_error_info"
                }
              ],
              "type": "module",
              "displayName": "Return values"
            },
            {
              "textRaw": "Exceptions",
              "name": "exceptions",
              "desc": "<p>Any N-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=\"n-api.html#n_api_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 an N-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. N-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 N-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=\"n-api.html#n_api_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=\"n-api.html#n_api_napi_throw\"><code>napi_throw</code></a> where error is the\nJavaScript <code>Error</code> object 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=\"n-api.html#n_api_napi_throw_error\"><code>napi_throw_error</code></a>,\n<a href=\"n-api.html#n_api_napi_throw_type_error\"><code>napi_throw_type_error</code></a>, <a href=\"n-api.html#n_api_napi_throw_range_error\"><code>napi_throw_range_error</code></a> and\n<a href=\"n-api.html#n_api_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=\"n-api.html#n_api_napi_create_error\"><code>napi_create_error</code></a>,\n<a href=\"n-api.html#n_api_napi_create_type_error\"><code>napi_create_type_error</code></a>, and <a href=\"n-api.html#n_api_napi_create_range_error\"><code>napi_create_range_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 N-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",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "napiVersion": [
                      1
                    ],
                    "changes": []
                  },
                  "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>",
                  "type": "module",
                  "displayName": "napi_throw"
                },
                {
                  "textRaw": "napi_throw_error",
                  "name": "napi_throw_error",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "napiVersion": [
                      1
                    ],
                    "changes": []
                  },
                  "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>",
                  "type": "module",
                  "displayName": "napi_throw_error"
                },
                {
                  "textRaw": "napi_throw_type_error",
                  "name": "napi_throw_type_error",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "napiVersion": [
                      1
                    ],
                    "changes": []
                  },
                  "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>",
                  "type": "module",
                  "displayName": "napi_throw_type_error"
                },
                {
                  "textRaw": "napi_throw_range_error",
                  "name": "napi_throw_range_error",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "napiVersion": [
                      1
                    ],
                    "changes": []
                  },
                  "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>",
                  "type": "module",
                  "displayName": "napi_throw_range_error"
                },
                {
                  "textRaw": "napi_is_error",
                  "name": "napi_is_error",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "napiVersion": [
                      1
                    ],
                    "changes": []
                  },
                  "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>",
                  "type": "module",
                  "displayName": "napi_is_error"
                },
                {
                  "textRaw": "napi_create_error",
                  "name": "napi_create_error",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "napiVersion": [
                      1
                    ],
                    "changes": []
                  },
                  "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>",
                  "type": "module",
                  "displayName": "napi_create_error"
                },
                {
                  "textRaw": "napi_create_type_error",
                  "name": "napi_create_type_error",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "napiVersion": [
                      1
                    ],
                    "changes": []
                  },
                  "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>",
                  "type": "module",
                  "displayName": "napi_create_type_error"
                },
                {
                  "textRaw": "napi_create_range_error",
                  "name": "napi_create_range_error",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "napiVersion": [
                      1
                    ],
                    "changes": []
                  },
                  "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>",
                  "type": "module",
                  "displayName": "napi_create_range_error"
                },
                {
                  "textRaw": "napi_get_and_clear_last_exception",
                  "name": "napi_get_and_clear_last_exception",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "napiVersion": [
                      1
                    ],
                    "changes": []
                  },
                  "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>",
                  "type": "module",
                  "displayName": "napi_get_and_clear_last_exception"
                },
                {
                  "textRaw": "napi_is_exception_pending",
                  "name": "napi_is_exception_pending",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "napiVersion": [
                      1
                    ],
                    "changes": []
                  },
                  "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>",
                  "type": "module",
                  "displayName": "napi_is_exception_pending"
                },
                {
                  "textRaw": "napi_fatal_exception",
                  "name": "napi_fatal_exception",
                  "meta": {
                    "added": [
                      "v9.10.0"
                    ],
                    "napiVersion": [
                      3
                    ],
                    "changes": []
                  },
                  "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>",
                  "type": "module",
                  "displayName": "napi_fatal_exception"
                }
              ],
              "type": "module",
              "displayName": "Exceptions"
            },
            {
              "textRaw": "Fatal errors",
              "name": "fatal_errors",
              "desc": "<p>In the event of an unrecoverable error in a native module, a fatal error can be\nthrown to immediately terminate the process.</p>",
              "modules": [
                {
                  "textRaw": "napi_fatal_error",
                  "name": "napi_fatal_error",
                  "meta": {
                    "added": [
                      "v8.2.0"
                    ],
                    "napiVersion": [
                      1
                    ],
                    "changes": []
                  },
                  "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>",
                  "type": "module",
                  "displayName": "napi_fatal_error"
                }
              ],
              "type": "module",
              "displayName": "Fatal errors"
            }
          ],
          "type": "misc",
          "displayName": "Error handling"
        },
        {
          "textRaw": "Object lifetime management",
          "name": "object_lifetime_management",
          "desc": "<p>As N-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 N-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",
              "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, N-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=\"n-api.html#n_api_napi_open_handle_scope\"><code>napi_open_handle_scope</code></a> and <a href=\"n-api.html#n_api_napi_close_handle_scope\"><code>napi_close_handle_scope</code></a>.</p>\n<p>N-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=\"n-api.html#n_api_napi_open_handle_scope\"><code>napi_open_handle_scope</code></a> and\n<a href=\"n-api.html#n_api_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. N-API supports an\n'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=\"n-api.html#n_api_napi_open_escapable_handle_scope\"><code>napi_open_escapable_handle_scope</code></a> and\n<a href=\"n-api.html#n_api_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=\"n-api.html#n_api_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",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "napiVersion": [
                      1
                    ],
                    "changes": []
                  },
                  "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>",
                  "type": "module",
                  "displayName": "napi_open_handle_scope"
                },
                {
                  "textRaw": "napi_close_handle_scope",
                  "name": "napi_close_handle_scope",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "napiVersion": [
                      1
                    ],
                    "changes": []
                  },
                  "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>",
                  "type": "module",
                  "displayName": "napi_close_handle_scope"
                },
                {
                  "textRaw": "napi_open_escapable_handle_scope",
                  "name": "napi_open_escapable_handle_scope",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "napiVersion": [
                      1
                    ],
                    "changes": []
                  },
                  "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>",
                  "type": "module",
                  "displayName": "napi_open_escapable_handle_scope"
                },
                {
                  "textRaw": "napi_close_escapable_handle_scope",
                  "name": "napi_close_escapable_handle_scope",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "napiVersion": [
                      1
                    ],
                    "changes": []
                  },
                  "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>",
                  "type": "module",
                  "displayName": "napi_close_escapable_handle_scope"
                },
                {
                  "textRaw": "napi_escape_handle",
                  "name": "napi_escape_handle",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "napiVersion": [
                      1
                    ],
                    "changes": []
                  },
                  "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>",
                  "type": "module",
                  "displayName": "napi_escape_handle"
                }
              ],
              "type": "module",
              "displayName": "Making handle lifespan shorter than that of the native method"
            },
            {
              "textRaw": "References to objects with a lifespan longer than that of the native method",
              "name": "references_to_objects_with_a_lifespan_longer_than_that_of_the_native_method",
              "desc": "<p>In some cases an addon will need to be able to create and reference objects\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 creates 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>N-API provides methods to create persistent references to an object.\nEach persistent reference has an associated count with a value of 0\nor higher. The count determines if the reference will keep\nthe corresponding object live. References with a count of 0 do not\nprevent the object from being collected and are often called 'weak'\nreferences. Any count greater than 0 will prevent the object\nfrom being collected.</p>\n<p>References can be created with an initial reference count. The count can\nthen be modified through <a href=\"n-api.html#n_api_napi_reference_ref\"><code>napi_reference_ref</code></a> and\n<a href=\"n-api.html#n_api_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=\"n-api.html#n_api_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=\"n-api.html#n_api_napi_reference_ref\"><code>napi_reference_ref</code></a> for a reference whose object has been collected\nwill result 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 will result 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.</p>",
              "modules": [
                {
                  "textRaw": "napi_create_reference",
                  "name": "napi_create_reference",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "napiVersion": [
                      1
                    ],
                    "changes": []
                  },
                  "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>: <code>napi_value</code> representing the <code>Object</code> to which we want a\nreference.</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 create a new reference with the specified reference count\nto the <code>Object</code> passed in.</p>",
                  "type": "module",
                  "displayName": "napi_create_reference"
                },
                {
                  "textRaw": "napi_delete_reference",
                  "name": "napi_delete_reference",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "napiVersion": [
                      1
                    ],
                    "changes": []
                  },
                  "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>",
                  "type": "module",
                  "displayName": "napi_delete_reference"
                },
                {
                  "textRaw": "napi_reference_ref",
                  "name": "napi_reference_ref",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "napiVersion": [
                      1
                    ],
                    "changes": []
                  },
                  "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>",
                  "type": "module",
                  "displayName": "napi_reference_ref"
                },
                {
                  "textRaw": "napi_reference_unref",
                  "name": "napi_reference_unref",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "napiVersion": [
                      1
                    ],
                    "changes": []
                  },
                  "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>",
                  "type": "module",
                  "displayName": "napi_reference_unref"
                },
                {
                  "textRaw": "napi_get_reference_value",
                  "name": "napi_get_reference_value",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "napiVersion": [
                      1
                    ],
                    "changes": []
                  },
                  "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<p>the <code>napi_value passed</code> in or out of these methods is a handle to the\nobject to which the reference is related.</p>\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 we requesting the corresponding <code>Object</code>.</li>\n<li><code>[out] result</code>: The <code>napi_value</code> for the <code>Object</code> referenced by the\n<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 <code>Object</code> associated with the <code>napi_ref</code>. Otherwise, result\nwill be <code>NULL</code>.</p>",
                  "type": "module",
                  "displayName": "napi_get_reference_value"
                }
              ],
              "type": "module",
              "displayName": "References to objects with a lifespan longer than that of the native method"
            },
            {
              "textRaw": "Cleanup on exit of the current Node.js instance",
              "name": "cleanup_on_exit_of_the_current_node.js_instance",
              "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 instance exits.</p>\n<p>N-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",
                  "meta": {
                    "added": [
                      "v10.2.0"
                    ],
                    "napiVersion": [
                      3
                    ],
                    "changes": []
                  },
                  "desc": "<pre><code class=\"language-c\">NODE_EXTERN napi_status napi_add_env_cleanup_hook(napi_env env,\n                                                  void (*fun)(void* arg),\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 <code>napi_remove_env_cleanup_hook</code>.\nTypically, that happens when the resource for which this hook was added\nis being torn down anyway.</p>",
                  "type": "module",
                  "displayName": "napi_add_env_cleanup_hook"
                },
                {
                  "textRaw": "napi_remove_env_cleanup_hook",
                  "name": "napi_remove_env_cleanup_hook",
                  "meta": {
                    "added": [
                      "v10.2.0"
                    ],
                    "napiVersion": [
                      3
                    ],
                    "changes": []
                  },
                  "desc": "<pre><code class=\"language-c\">NAPI_EXTERN napi_status napi_remove_env_cleanup_hook(napi_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>",
                  "type": "module",
                  "displayName": "napi_remove_env_cleanup_hook"
                }
              ],
              "type": "module",
              "displayName": "Cleanup on exit of the current Node.js instance"
            }
          ],
          "type": "misc",
          "displayName": "Object lifetime management"
        },
        {
          "textRaw": "Module registration",
          "name": "module_registration",
          "desc": "<p>N-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 N-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. N-API modules cannot modify the <code>module</code> object but can\nspecify 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\", NULL, Method, NULL, NULL, NULL, napi_default, NULL};\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=\"n-api.html#n_api_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_default, 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>If the module will be loaded multiple times during the lifetime of the Node.js\nprocess, use the <code>NAPI_MODULE_INIT</code> macro to initialize the module:</p>\n<pre><code class=\"language-c\">NAPI_MODULE_INIT() {\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>This macro includes <code>NAPI_MODULE</code>, and declares an <code>Init</code> function with a\nspecial name and with visibility beyond the addon. This will allow Node.js to\ninitialize the module even if it is loaded multiple times.</p>\n<p>There are a few design considerations when declaring a module that may be loaded\nmultiple times. The documentation of <a href=\"addons.html#addons_context_aware_addons\">context-aware addons</a> provides more\ndetails.</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=\"n-api.html#n_api_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>",
          "type": "misc",
          "displayName": "Module registration"
        },
        {
          "textRaw": "Working with JavaScript values",
          "name": "working_with_javascript_values",
          "desc": "<p>N-API exposes a set of APIs to create all types of JavaScript values.\nSome of these types are documented under <a href=\"https://tc39.github.io/ecma262/#sec-ecmascript-data-types-and-values\">Section 6</a>\nof the <a href=\"https://tc39.github.io/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 an N-API value</li>\n<li>Convert from N-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>N-API values are represented by the type <code>napi_value</code>.\nAny N-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",
              "modules": [
                {
                  "textRaw": "napi_key_collection_mode",
                  "name": "napi_key_collection_mode",
                  "meta": {
                    "added": [
                      "v12.17.0"
                    ],
                    "napiVersion": [
                      6
                    ],
                    "changes": []
                  },
                  "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>",
                  "type": "module",
                  "displayName": "napi_key_collection_mode"
                },
                {
                  "textRaw": "napi_key_filter",
                  "name": "napi_key_filter",
                  "meta": {
                    "added": [
                      "v12.17.0"
                    ],
                    "napiVersion": [
                      6
                    ],
                    "changes": []
                  },
                  "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 bits. They can be or'ed to build a composite filter.</p>",
                  "type": "module",
                  "displayName": "napi_key_filter"
                },
                {
                  "textRaw": "napi_key_conversion",
                  "name": "napi_key_conversion",
                  "meta": {
                    "added": [
                      "v12.17.0"
                    ],
                    "napiVersion": [
                      6
                    ],
                    "changes": []
                  },
                  "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 indices to\nstrings. <code>napi_key_keep_numbers</code> will return numbers for integer\nindices.</p>",
                  "type": "module",
                  "displayName": "napi_key_conversion"
                },
                {
                  "textRaw": "napi_valuetype",
                  "name": "napi_valuetype",
                  "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.github.io/ecma262/#sec-ecmascript-language-types\">Section 6.1</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>",
                  "type": "module",
                  "displayName": "napi_valuetype"
                },
                {
                  "textRaw": "napi_typedarray_type",
                  "name": "napi_typedarray_type",
                  "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_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.github.io/ecma262/#sec-typedarray-objects\">Section 22.2</a> of the <a href=\"https://tc39.github.io/ecma262/\">ECMAScript Language Specification</a>.</p>",
                  "type": "module",
                  "displayName": "napi_typedarray_type"
                }
              ],
              "type": "module",
              "displayName": "Enum types"
            },
            {
              "textRaw": "Object creation functions",
              "name": "object_creation_functions",
              "modules": [
                {
                  "textRaw": "napi_create_array",
                  "name": "napi_create_array",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "napiVersion": [
                      1
                    ],
                    "changes": []
                  },
                  "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 N-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 an N-API value corresponding to a JavaScript <code>Array</code> type.\nJavaScript arrays are described in\n<a href=\"https://tc39.github.io/ecma262/#sec-array-objects\">Section 22.1</a> of the ECMAScript Language Specification.</p>",
                  "type": "module",
                  "displayName": "napi_create_array"
                },
                {
                  "textRaw": "napi_create_array_with_length",
                  "name": "napi_create_array_with_length",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "napiVersion": [
                      1
                    ],
                    "changes": []
                  },
                  "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 an N-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=\"n-api.html#n_api_napi_create_external_arraybuffer\"><code>napi_create_external_arraybuffer</code></a>.</p>\n<p>JavaScript arrays are described in\n<a href=\"https://tc39.github.io/ecma262/#sec-array-objects\">Section 22.1</a> of the ECMAScript Language Specification.</p>",
                  "type": "module",
                  "displayName": "napi_create_array_with_length"
                },
                {
                  "textRaw": "napi_create_arraybuffer",
                  "name": "napi_create_arraybuffer",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "napiVersion": [
                      1
                    ],
                    "changes": []
                  },
                  "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>.</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 an N-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.github.io/ecma262/#sec-arraybuffer-objects\">Section 24.1</a> of the ECMAScript Language Specification.</p>",
                  "type": "module",
                  "displayName": "napi_create_arraybuffer"
                },
                {
                  "textRaw": "napi_create_buffer",
                  "name": "napi_create_buffer",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "napiVersion": [
                      1
                    ],
                    "changes": []
                  },
                  "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.</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>",
                  "type": "module",
                  "displayName": "napi_create_buffer"
                },
                {
                  "textRaw": "napi_create_buffer_copy",
                  "name": "napi_create_buffer_copy",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "napiVersion": [
                      1
                    ],
                    "changes": []
                  },
                  "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.</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>",
                  "type": "module",
                  "displayName": "napi_create_buffer_copy"
                },
                {
                  "textRaw": "napi_create_date",
                  "name": "napi_create_date",
                  "meta": {
                    "added": [
                      "v11.11.0"
                    ],
                    "napiVersion": [
                      5
                    ],
                    "changes": []
                  },
                  "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.github.io/ecma262/#sec-date-objects\">Section 20.3</a> of the ECMAScript Language Specification.</p>",
                  "type": "module",
                  "displayName": "napi_create_date"
                },
                {
                  "textRaw": "napi_create_external",
                  "name": "napi_create_external",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "napiVersion": [
                      1
                    ],
                    "changes": []
                  },
                  "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.</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=\"n-api.html#n_api_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 is ready for garbage collection. It is similar to\n<code>napi_wrap()</code> except that:</p>\n<ul>\n<li>the native data cannot be retrieved later using <code>napi_unwrap()</code>,</li>\n<li>nor can it be removed later using <code>napi_remove_wrap()</code>, and</li>\n<li>the object created by the API can be used with <code>napi_wrap()</code>.</li>\n</ul>\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>",
                  "type": "module",
                  "displayName": "napi_create_external"
                },
                {
                  "textRaw": "napi_create_external_arraybuffer",
                  "name": "napi_create_external_arraybuffer",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "napiVersion": [
                      1
                    ],
                    "changes": []
                  },
                  "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.</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>This API returns an N-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 is ready for garbage collection. It is similar to\n<code>napi_wrap()</code> except that:</p>\n<ul>\n<li>the native data cannot be retrieved later using <code>napi_unwrap()</code>,</li>\n<li>nor can it be removed later using <code>napi_remove_wrap()</code>, and</li>\n<li>the object created by the API can be used with <code>napi_wrap()</code>.</li>\n</ul>\n<p>JavaScript <code>ArrayBuffer</code>s are described in\n<a href=\"https://tc39.github.io/ecma262/#sec-arraybuffer-objects\">Section 24.1</a> of the ECMAScript Language Specification.</p>",
                  "type": "module",
                  "displayName": "napi_create_external_arraybuffer"
                },
                {
                  "textRaw": "napi_create_external_buffer",
                  "name": "napi_create_external_buffer",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "napiVersion": [
                      1
                    ],
                    "changes": []
                  },
                  "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 copy from.</li>\n<li><code>[in] finalize_cb</code>: Optional callback to call when the <code>ArrayBuffer</code> is being\ncollected.</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>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 is ready for garbage collection. It is similar to\n<code>napi_wrap()</code> except that:</p>\n<ul>\n<li>the native data cannot be retrieved later using <code>napi_unwrap()</code>,</li>\n<li>nor can it be removed later using <code>napi_remove_wrap()</code>, and</li>\n<li>the object created by the API can be used with <code>napi_wrap()</code>.</li>\n</ul>\n<p>For Node.js >=4 <code>Buffers</code> are <code>Uint8Array</code>s.</p>",
                  "type": "module",
                  "displayName": "napi_create_external_buffer"
                },
                {
                  "textRaw": "napi_create_object",
                  "name": "napi_create_object",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "napiVersion": [
                      1
                    ],
                    "changes": []
                  },
                  "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.github.io/ecma262/#sec-object-type\">Section 6.1.7</a> of the\nECMAScript Language Specification.</p>",
                  "type": "module",
                  "displayName": "napi_create_object"
                },
                {
                  "textRaw": "napi_create_symbol",
                  "name": "napi_create_symbol",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "napiVersion": [
                      1
                    ],
                    "changes": []
                  },
                  "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> object from a UTF8-encoded C string.</p>\n<p>The JavaScript <code>Symbol</code> type is described in <a href=\"https://tc39.github.io/ecma262/#sec-symbol-objects\">Section 19.4</a>\nof the ECMAScript Language Specification.</p>",
                  "type": "module",
                  "displayName": "napi_create_symbol"
                },
                {
                  "textRaw": "napi_create_typedarray",
                  "name": "napi_create_typedarray",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "napiVersion": [
                      1
                    ],
                    "changes": []
                  },
                  "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> underlying the typed array.</li>\n<li><code>[in] byte_offset</code>: The byte offset within the <code>ArrayBuffer</code> from which to\nstart 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>. <code>TypedArray</code> objects provide an array-like view over an\nunderlying data buffer where each element has the same underlying binary scalar\ndatatype.</p>\n<p>It's required that <code>(length * size_of_element) + byte_offset</code> should\nbe &#x3C;= the size in bytes of the array passed in. If not, a <code>RangeError</code> exception\nis raised.</p>\n<p>JavaScript <code>TypedArray</code> objects are described in\n<a href=\"https://tc39.github.io/ecma262/#sec-typedarray-objects\">Section 22.2</a> of the ECMAScript Language Specification.</p>",
                  "type": "module",
                  "displayName": "napi_create_typedarray"
                },
                {
                  "textRaw": "napi_create_dataview",
                  "name": "napi_create_dataview",
                  "meta": {
                    "added": [
                      "v8.3.0"
                    ],
                    "napiVersion": [
                      1
                    ],
                    "changes": []
                  },
                  "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> underlying the <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>.\n<code>DataView</code> objects provide an array-like view over an underlying data buffer,\nbut one which allows items of different size and type in the <code>ArrayBuffer</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.github.io/ecma262/#sec-dataview-objects\">Section 24.3</a> of the ECMAScript Language Specification.</p>",
                  "type": "module",
                  "displayName": "napi_create_dataview"
                }
              ],
              "type": "module",
              "displayName": "Object creation functions"
            },
            {
              "textRaw": "Functions to convert from C types to N-API",
              "name": "functions_to_convert_from_c_types_to_n-api",
              "modules": [
                {
                  "textRaw": "napi_create_int32",
                  "name": "napi_create_int32",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "napiVersion": [
                      1
                    ],
                    "changes": []
                  },
                  "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.github.io/ecma262/#sec-ecmascript-language-types-number-type\">Section 6.1.6</a> of the ECMAScript Language Specification.</p>",
                  "type": "module",
                  "displayName": "napi_create_int32"
                },
                {
                  "textRaw": "napi_create_uint32",
                  "name": "napi_create_uint32",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "napiVersion": [
                      1
                    ],
                    "changes": []
                  },
                  "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.github.io/ecma262/#sec-ecmascript-language-types-number-type\">Section 6.1.6</a> of the ECMAScript Language Specification.</p>",
                  "type": "module",
                  "displayName": "napi_create_uint32"
                },
                {
                  "textRaw": "napi_create_int64",
                  "name": "napi_create_int64",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "napiVersion": [
                      1
                    ],
                    "changes": []
                  },
                  "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.github.io/ecma262/#sec-ecmascript-language-types-number-type\">Section 6.1.6</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.github.io/ecma262/#sec-number.min_safe_integer\"><code>Number.MIN_SAFE_INTEGER</code></a> <code>-(2^53 - 1)</code> -\n<a href=\"https://tc39.github.io/ecma262/#sec-number.max_safe_integer\"><code>Number.MAX_SAFE_INTEGER</code></a> <code>(2^53 - 1)</code> will lose precision.</p>",
                  "type": "module",
                  "displayName": "napi_create_int64"
                },
                {
                  "textRaw": "napi_create_double",
                  "name": "napi_create_double",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "napiVersion": [
                      1
                    ],
                    "changes": []
                  },
                  "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.github.io/ecma262/#sec-ecmascript-language-types-number-type\">Section 6.1.6</a> of the ECMAScript Language Specification.</p>",
                  "type": "module",
                  "displayName": "napi_create_double"
                },
                {
                  "textRaw": "napi_create_bigint_int64",
                  "name": "napi_create_bigint_int64",
                  "meta": {
                    "added": [
                      "v10.7.0"
                    ],
                    "napiVersion": [
                      6
                    ],
                    "changes": []
                  },
                  "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>",
                  "type": "module",
                  "displayName": "napi_create_bigint_int64"
                },
                {
                  "textRaw": "napi_create_bigint_uint64",
                  "name": "napi_create_bigint_uint64",
                  "meta": {
                    "added": [
                      "v10.7.0"
                    ],
                    "napiVersion": [
                      6
                    ],
                    "changes": []
                  },
                  "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>",
                  "type": "module",
                  "displayName": "napi_create_bigint_uint64"
                },
                {
                  "textRaw": "napi_create_bigint_words",
                  "name": "napi_create_bigint_words",
                  "meta": {
                    "added": [
                      "v10.7.0"
                    ],
                    "napiVersion": [
                      6
                    ],
                    "changes": []
                  },
                  "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>",
                  "type": "module",
                  "displayName": "napi_create_bigint_words"
                },
                {
                  "textRaw": "napi_create_string_latin1",
                  "name": "napi_create_string_latin1",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "napiVersion": [
                      1
                    ],
                    "changes": []
                  },
                  "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> object 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.github.io/ecma262/#sec-ecmascript-language-types-string-type\">Section 6.1.4</a> of the ECMAScript Language Specification.</p>",
                  "type": "module",
                  "displayName": "napi_create_string_latin1"
                },
                {
                  "textRaw": "napi_create_string_utf16",
                  "name": "napi_create_string_utf16",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "napiVersion": [
                      1
                    ],
                    "changes": []
                  },
                  "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> object 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.github.io/ecma262/#sec-ecmascript-language-types-string-type\">Section 6.1.4</a> of the ECMAScript Language Specification.</p>",
                  "type": "module",
                  "displayName": "napi_create_string_utf16"
                },
                {
                  "textRaw": "napi_create_string_utf8",
                  "name": "napi_create_string_utf8",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "napiVersion": [
                      1
                    ],
                    "changes": []
                  },
                  "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> object 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.github.io/ecma262/#sec-ecmascript-language-types-string-type\">Section 6.1.4</a> of the ECMAScript Language Specification.</p>",
                  "type": "module",
                  "displayName": "napi_create_string_utf8"
                }
              ],
              "type": "module",
              "displayName": "Functions to convert from C types to N-API"
            },
            {
              "textRaw": "Functions to convert from N-API to C types",
              "name": "functions_to_convert_from_n-api_to_c_types",
              "modules": [
                {
                  "textRaw": "napi_get_array_length",
                  "name": "napi_get_array_length",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "napiVersion": [
                      1
                    ],
                    "changes": []
                  },
                  "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.github.io/ecma262/#sec-properties-of-array-instances-length\">Section 22.1.4.1</a> of the ECMAScript Language\nSpecification.</p>",
                  "type": "module",
                  "displayName": "napi_get_array_length"
                },
                {
                  "textRaw": "napi_get_arraybuffer_info",
                  "name": "napi_get_arraybuffer_info",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "napiVersion": [
                      1
                    ],
                    "changes": []
                  },
                  "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> being queried.</li>\n<li><code>[out] data</code>: The underlying data buffer of the <code>ArrayBuffer</code>. If byte_length\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> and\nits 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> even after it's returned. A\npossible safe way to use this API is in conjunction with\n<a href=\"n-api.html#n_api_napi_create_reference\"><code>napi_create_reference</code></a>, which can be used to guarantee control over the\nlifetime of the <code>ArrayBuffer</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>",
                  "type": "module",
                  "displayName": "napi_get_arraybuffer_info"
                },
                {
                  "textRaw": "napi_get_buffer_info",
                  "name": "napi_get_buffer_info",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "napiVersion": [
                      1
                    ],
                    "changes": []
                  },
                  "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> being queried.</li>\n<li><code>[out] data</code>: The underlying data buffer of the <code>node::Buffer</code>.\nIf 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 API is used to retrieve the underlying data buffer of a <code>node::Buffer</code>\nand it's 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>",
                  "type": "module",
                  "displayName": "napi_get_buffer_info"
                },
                {
                  "textRaw": "napi_get_prototype",
                  "name": "napi_get_prototype",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "napiVersion": [
                      1
                    ],
                    "changes": []
                  },
                  "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>",
                  "type": "module",
                  "displayName": "napi_get_prototype"
                },
                {
                  "textRaw": "napi_get_typedarray_info",
                  "name": "napi_get_typedarray_info",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "napiVersion": [
                      1
                    ],
                    "changes": []
                  },
                  "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> underlying the <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><em>Warning</em>: Use caution while using this API since the underlying data buffer\nis managed by the VM.</p>",
                  "type": "module",
                  "displayName": "napi_get_typedarray_info"
                },
                {
                  "textRaw": "napi_get_dataview_info",
                  "name": "napi_get_dataview_info",
                  "meta": {
                    "added": [
                      "v8.3.0"
                    ],
                    "napiVersion": [
                      1
                    ],
                    "changes": []
                  },
                  "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>: <code>Number</code> 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>This API returns various properties of a <code>DataView</code>.</p>",
                  "type": "module",
                  "displayName": "napi_get_dataview_info"
                },
                {
                  "textRaw": "napi_get_date_value",
                  "name": "napi_get_date_value",
                  "meta": {
                    "added": [
                      "v11.11.0"
                    ],
                    "napiVersion": [
                      5
                    ],
                    "changes": []
                  },
                  "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>",
                  "type": "module",
                  "displayName": "napi_get_date_value"
                },
                {
                  "textRaw": "napi_get_value_bool",
                  "name": "napi_get_value_bool",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "napiVersion": [
                      1
                    ],
                    "changes": []
                  },
                  "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>",
                  "type": "module",
                  "displayName": "napi_get_value_bool"
                },
                {
                  "textRaw": "napi_get_value_double",
                  "name": "napi_get_value_double",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "napiVersion": [
                      1
                    ],
                    "changes": []
                  },
                  "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>",
                  "type": "module",
                  "displayName": "napi_get_value_double"
                },
                {
                  "textRaw": "napi_get_value_bigint_int64",
                  "name": "napi_get_value_bigint_int64",
                  "meta": {
                    "added": [
                      "v10.7.0"
                    ],
                    "napiVersion": [
                      6
                    ],
                    "changes": []
                  },
                  "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>",
                  "type": "module",
                  "displayName": "napi_get_value_bigint_int64"
                },
                {
                  "textRaw": "napi_get_value_bigint_uint64",
                  "name": "napi_get_value_bigint_uint64",
                  "meta": {
                    "added": [
                      "v10.7.0"
                    ],
                    "napiVersion": [
                      6
                    ],
                    "changes": []
                  },
                  "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>",
                  "type": "module",
                  "displayName": "napi_get_value_bigint_uint64"
                },
                {
                  "textRaw": "napi_get_value_bigint_words",
                  "name": "napi_get_value_bigint_words",
                  "meta": {
                    "added": [
                      "v10.7.0"
                    ],
                    "napiVersion": [
                      6
                    ],
                    "changes": []
                  },
                  "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>",
                  "type": "module",
                  "displayName": "napi_get_value_bigint_words"
                },
                {
                  "textRaw": "napi_get_value_external",
                  "name": "napi_get_value_external",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "napiVersion": [
                      1
                    ],
                    "changes": []
                  },
                  "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>",
                  "type": "module",
                  "displayName": "napi_get_value_external"
                },
                {
                  "textRaw": "napi_get_value_int32",
                  "name": "napi_get_value_int32",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "napiVersion": [
                      1
                    ],
                    "changes": []
                  },
                  "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^31 -1.</p>\n<p>Non-finite number values (<code>NaN</code>, <code>+Infinity</code>, or <code>-Infinity</code>) set the\nresult to zero.</p>",
                  "type": "module",
                  "displayName": "napi_get_value_int32"
                },
                {
                  "textRaw": "napi_get_value_int64",
                  "name": "napi_get_value_int64",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "napiVersion": [
                      1
                    ],
                    "changes": []
                  },
                  "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.github.io/ecma262/#sec-number.min_safe_integer\"><code>Number.MIN_SAFE_INTEGER</code></a>\n<code>-(2^53 - 1)</code> - <a href=\"https://tc39.github.io/ecma262/#sec-number.max_safe_integer\"><code>Number.MAX_SAFE_INTEGER</code></a> <code>(2^53 - 1)</code> will lose precision.</p>\n<p>Non-finite number values (<code>NaN</code>, <code>+Infinity</code>, or <code>-Infinity</code>) set the\nresult to zero.</p>",
                  "type": "module",
                  "displayName": "napi_get_value_int64"
                },
                {
                  "textRaw": "napi_get_value_string_latin1",
                  "name": "napi_get_value_string_latin1",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "napiVersion": [
                      1
                    ],
                    "changes": []
                  },
                  "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) is returned.</li>\n<li><code>[in] bufsize</code>: Size of the destination buffer. When this value is\ninsufficient, the returned string will be truncated.</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>",
                  "type": "module",
                  "displayName": "napi_get_value_string_latin1"
                },
                {
                  "textRaw": "napi_get_value_string_utf8",
                  "name": "napi_get_value_string_utf8",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "napiVersion": [
                      1
                    ],
                    "changes": []
                  },
                  "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) is returned.</li>\n<li><code>[in] bufsize</code>: Size of the destination buffer. When this value is\ninsufficient, the returned string will be truncated.</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>",
                  "type": "module",
                  "displayName": "napi_get_value_string_utf8"
                },
                {
                  "textRaw": "napi_get_value_string_utf16",
                  "name": "napi_get_value_string_utf16",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "napiVersion": [
                      1
                    ],
                    "changes": []
                  },
                  "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) is returned.</li>\n<li><code>[in] bufsize</code>: Size of the destination buffer. When this value is\ninsufficient, the returned string will be truncated.</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>",
                  "type": "module",
                  "displayName": "napi_get_value_string_utf16"
                },
                {
                  "textRaw": "napi_get_value_uint32",
                  "name": "napi_get_value_uint32",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "napiVersion": [
                      1
                    ],
                    "changes": []
                  },
                  "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>",
                  "type": "module",
                  "displayName": "napi_get_value_uint32"
                }
              ],
              "type": "module",
              "displayName": "Functions to convert from N-API to C types"
            },
            {
              "textRaw": "Functions to get global instances",
              "name": "functions_to_get_global_instances",
              "modules": [
                {
                  "textRaw": "napi_get_boolean",
                  "name": "napi_get_boolean",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "napiVersion": [
                      1
                    ],
                    "changes": []
                  },
                  "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>",
                  "type": "module",
                  "displayName": "napi_get_boolean"
                },
                {
                  "textRaw": "napi_get_global",
                  "name": "napi_get_global",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "napiVersion": [
                      1
                    ],
                    "changes": []
                  },
                  "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>",
                  "type": "module",
                  "displayName": "napi_get_global"
                },
                {
                  "textRaw": "napi_get_null",
                  "name": "napi_get_null",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "napiVersion": [
                      1
                    ],
                    "changes": []
                  },
                  "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>",
                  "type": "module",
                  "displayName": "napi_get_null"
                },
                {
                  "textRaw": "napi_get_undefined",
                  "name": "napi_get_undefined",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "napiVersion": [
                      1
                    ],
                    "changes": []
                  },
                  "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>",
                  "type": "module",
                  "displayName": "napi_get_undefined"
                }
              ],
              "type": "module",
              "displayName": "Functions to get global instances"
            }
          ],
          "type": "misc",
          "displayName": "Working with JavaScript values"
        },
        {
          "textRaw": "Working with JavaScript values and abstract operations",
          "name": "working_with_javascript_values_and_abstract_operations",
          "desc": "<p>N-API exposes a set of APIs to perform some abstract operations on JavaScript\nvalues. Some of these operations are documented under <a href=\"https://tc39.github.io/ecma262/#sec-abstract-operations\">Section 7</a>\nof the <a href=\"https://tc39.github.io/ecma262/\">ECMAScript Language Specification</a>.</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",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "napiVersion": [
                  1
                ],
                "changes": []
              },
              "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.github.io/ecma262/#sec-toboolean\">Section 7.1.2</a> of the ECMAScript Language Specification.\nThis API can be re-entrant if getters are defined on the passed-in <code>Object</code>.</p>",
              "type": "module",
              "displayName": "napi_coerce_to_bool"
            },
            {
              "textRaw": "napi_coerce_to_number",
              "name": "napi_coerce_to_number",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "napiVersion": [
                  1
                ],
                "changes": []
              },
              "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.github.io/ecma262/#sec-tonumber\">Section 7.1.3</a> of the ECMAScript Language Specification.\nThis API can be re-entrant if getters are defined on the passed-in <code>Object</code>.</p>",
              "type": "module",
              "displayName": "napi_coerce_to_number"
            },
            {
              "textRaw": "napi_coerce_to_object",
              "name": "napi_coerce_to_object",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "napiVersion": [
                  1
                ],
                "changes": []
              },
              "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.github.io/ecma262/#sec-toobject\">Section 7.1.13</a> of the ECMAScript Language Specification.\nThis API can be re-entrant if getters are defined on the passed-in <code>Object</code>.</p>",
              "type": "module",
              "displayName": "napi_coerce_to_object"
            },
            {
              "textRaw": "napi_coerce_to_string",
              "name": "napi_coerce_to_string",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "napiVersion": [
                  1
                ],
                "changes": []
              },
              "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.github.io/ecma262/#sec-toobject\">Section 7.1.13</a> of the ECMAScript Language Specification.\nThis API can be re-entrant if getters are defined on the passed-in <code>Object</code>.</p>",
              "type": "module",
              "displayName": "napi_coerce_to_string"
            },
            {
              "textRaw": "napi_typeof",
              "name": "napi_typeof",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "napiVersion": [
                  1
                ],
                "changes": []
              },
              "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.github.io/ecma262/#sec-typeof-operator\">Section 12.5.5</a> of the ECMAScript Language\nSpecification. However, it has support for detecting an External value.\nIf <code>value</code> has a type that is invalid, an error is returned.</p>",
              "type": "module",
              "displayName": "napi_typeof"
            },
            {
              "textRaw": "napi_instanceof",
              "name": "napi_instanceof",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "napiVersion": [
                  1
                ],
                "changes": []
              },
              "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.github.io/ecma262/#sec-instanceofoperator\">Section 12.10.4</a> of the ECMAScript Language Specification.</p>",
              "type": "module",
              "displayName": "napi_instanceof"
            },
            {
              "textRaw": "napi_is_array",
              "name": "napi_is_array",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "napiVersion": [
                  1
                ],
                "changes": []
              },
              "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.github.io/ecma262/#sec-isarray\">Section 7.2.2</a> of the ECMAScript Language Specification.</p>",
              "type": "module",
              "displayName": "napi_is_array"
            },
            {
              "textRaw": "napi_is_arraybuffer",
              "name": "napi_is_arraybuffer",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "napiVersion": [
                  1
                ],
                "changes": []
              },
              "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>",
              "type": "module",
              "displayName": "napi_is_arraybuffer"
            },
            {
              "textRaw": "napi_is_buffer",
              "name": "napi_is_buffer",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "napiVersion": [
                  1
                ],
                "changes": []
              },
              "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>\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 buffer.</p>",
              "type": "module",
              "displayName": "napi_is_buffer"
            },
            {
              "textRaw": "napi_is_date",
              "name": "napi_is_date",
              "meta": {
                "added": [
                  "v11.11.0"
                ],
                "napiVersion": [
                  5
                ],
                "changes": []
              },
              "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>",
              "type": "module",
              "displayName": "napi_is_date"
            },
            {
              "textRaw": "napi_is_error",
              "name": "napi_is_error",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "napiVersion": [
                  1
                ],
                "changes": []
              },
              "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>",
              "type": "module",
              "displayName": "napi_is_error"
            },
            {
              "textRaw": "napi_is_typedarray",
              "name": "napi_is_typedarray",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "napiVersion": [
                  1
                ],
                "changes": []
              },
              "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>",
              "type": "module",
              "displayName": "napi_is_typedarray"
            },
            {
              "textRaw": "napi_is_dataview",
              "name": "napi_is_dataview",
              "meta": {
                "added": [
                  "v8.3.0"
                ],
                "napiVersion": [
                  1
                ],
                "changes": []
              },
              "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>",
              "type": "module",
              "displayName": "napi_is_dataview"
            },
            {
              "textRaw": "napi_strict_equals",
              "name": "napi_strict_equals",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "napiVersion": [
                  1
                ],
                "changes": []
              },
              "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.github.io/ecma262/#sec-strict-equality-comparison\">Section 7.2.14</a> of the ECMAScript Language Specification.</p>",
              "type": "module",
              "displayName": "napi_strict_equals"
            },
            {
              "textRaw": "napi_detach_arraybuffer",
              "name": "napi_detach_arraybuffer",
              "meta": {
                "added": [
                  "v12.16.0"
                ],
                "changes": []
              },
              "stability": 1,
              "stabilityText": "Experimental",
              "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=\"n-api.html#n_api_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 24.1.1.3</a> of the ECMAScript Language Specification.</p>",
              "type": "module",
              "displayName": "napi_detach_arraybuffer"
            },
            {
              "textRaw": "napi_is_detached_arraybuffer",
              "name": "napi_is_detached_arraybuffer",
              "meta": {
                "added": [
                  "v12.16.0"
                ],
                "changes": []
              },
              "stability": 1,
              "stabilityText": "Experimental",
              "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 24.1.1.2</a> of the ECMAScript Language\nSpecification.</p>",
              "type": "module",
              "displayName": "napi_is_detached_arraybuffer"
            }
          ],
          "type": "misc",
          "displayName": "Working with JavaScript values and abstract operations"
        },
        {
          "textRaw": "Working with JavaScript properties",
          "name": "working_with_javascript_properties",
          "desc": "<p>N-API exposes a set of APIs to get and set properties on JavaScript\nobjects. Some of these types are documented under <a href=\"https://tc39.github.io/ecma262/#sec-abstract-operations\">Section 7</a> of the\n<a href=\"https://tc39.github.io/ecma262/\">ECMAScript Language Specification</a>.</p>\n<p>Properties in JavaScript are represented as a tuple of a key and a value.\nFundamentally, all property keys in N-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 N-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>N-API values are represented by the type <code>napi_value</code>.\nAny N-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 N-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 N-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 N-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 N-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_default, NULL },\n  { \"bar\", NULL, NULL, NULL, NULL, barValue, napi_default, 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",
              "modules": [
                {
                  "textRaw": "napi_property_attributes",
                  "name": "napi_property_attributes",
                  "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} napi_property_attributes;\n</code></pre>\n<p><code>napi_property_attributes</code> are flags used to control the behavior of properties\nset on a JavaScript object. Other than <code>napi_static</code> they correspond to the\nattributes listed in <a href=\"https://tc39.github.io/ecma262/#table-2\">Section 6.1.7.1</a>\nof the <a href=\"https://tc39.github.io/ecma262/\">ECMAScript Language Specification</a>.\nThey can be one or more of the following bitflags:</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.github.io/ecma262/#table-2\">Section 6.1.7.1</a> of the <a href=\"https://tc39.github.io/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=\"n-api.html#n_api_napi_define_class\"><code>napi_define_class</code></a>. It is ignored by <code>napi_define_properties</code>.</li>\n</ul>",
                  "type": "module",
                  "displayName": "napi_property_attributes"
                },
                {
                  "textRaw": "napi_property_descriptor",
                  "name": "napi_property_descriptor",
                  "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 <code>String</code> 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 N-API call).</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 N-API call).</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).</li>\n<li><code>attributes</code>: The attributes associated with the particular property. See\n<a href=\"n-api.html#n_api_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>",
                  "type": "module",
                  "displayName": "napi_property_descriptor"
                }
              ],
              "type": "module",
              "displayName": "Structures"
            },
            {
              "textRaw": "Functions",
              "name": "functions",
              "modules": [
                {
                  "textRaw": "napi_get_property_names",
                  "name": "napi_get_property_names",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "napiVersion": [
                      1
                    ],
                    "changes": []
                  },
                  "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 N-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=\"n-api.html#n_api_napi_get_array_length\"><code>napi_get_array_length</code></a>\nand <a href=\"n-api.html#n_api_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>",
                  "type": "module",
                  "displayName": "napi_get_property_names"
                },
                {
                  "textRaw": "napi_get_all_property_names",
                  "name": "napi_get_all_property_names",
                  "meta": {
                    "added": [
                      "v12.17.0"
                    ],
                    "napiVersion": [
                      6
                    ],
                    "changes": []
                  },
                  "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 N-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=\"n-api.html#n_api_napi_get_array_length\"><code>napi_get_array_length</code></a> and\n<a href=\"n-api.html#n_api_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>",
                  "type": "module",
                  "displayName": "napi_get_all_property_names"
                },
                {
                  "textRaw": "napi_set_property",
                  "name": "napi_set_property",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "napiVersion": [
                      1
                    ],
                    "changes": []
                  },
                  "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 N-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>",
                  "type": "module",
                  "displayName": "napi_set_property"
                },
                {
                  "textRaw": "napi_get_property",
                  "name": "napi_get_property",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "napiVersion": [
                      1
                    ],
                    "changes": []
                  },
                  "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 N-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>",
                  "type": "module",
                  "displayName": "napi_get_property"
                },
                {
                  "textRaw": "napi_has_property",
                  "name": "napi_has_property",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "napiVersion": [
                      1
                    ],
                    "changes": []
                  },
                  "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 N-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>",
                  "type": "module",
                  "displayName": "napi_has_property"
                },
                {
                  "textRaw": "napi_delete_property",
                  "name": "napi_delete_property",
                  "meta": {
                    "added": [
                      "v8.2.0"
                    ],
                    "napiVersion": [
                      1
                    ],
                    "changes": []
                  },
                  "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 N-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>",
                  "type": "module",
                  "displayName": "napi_delete_property"
                },
                {
                  "textRaw": "napi_has_own_property",
                  "name": "napi_has_own_property",
                  "meta": {
                    "added": [
                      "v8.2.0"
                    ],
                    "napiVersion": [
                      1
                    ],
                    "changes": []
                  },
                  "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 N-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 string or a <code>Symbol</code>, or an error will be thrown. N-API will not perform\nany conversion between data types.</p>",
                  "type": "module",
                  "displayName": "napi_has_own_property"
                },
                {
                  "textRaw": "napi_set_named_property",
                  "name": "napi_set_named_property",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "napiVersion": [
                      1
                    ],
                    "changes": []
                  },
                  "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 N-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=\"n-api.html#n_api_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>",
                  "type": "module",
                  "displayName": "napi_set_named_property"
                },
                {
                  "textRaw": "napi_get_named_property",
                  "name": "napi_get_named_property",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "napiVersion": [
                      1
                    ],
                    "changes": []
                  },
                  "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 N-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=\"n-api.html#n_api_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>",
                  "type": "module",
                  "displayName": "napi_get_named_property"
                },
                {
                  "textRaw": "napi_has_named_property",
                  "name": "napi_has_named_property",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "napiVersion": [
                      1
                    ],
                    "changes": []
                  },
                  "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 N-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=\"n-api.html#n_api_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>",
                  "type": "module",
                  "displayName": "napi_has_named_property"
                },
                {
                  "textRaw": "napi_set_element",
                  "name": "napi_set_element",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "napiVersion": [
                      1
                    ],
                    "changes": []
                  },
                  "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 N-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 and element on the <code>Object</code> passed in.</p>",
                  "type": "module",
                  "displayName": "napi_set_element"
                },
                {
                  "textRaw": "napi_get_element",
                  "name": "napi_get_element",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "napiVersion": [
                      1
                    ],
                    "changes": []
                  },
                  "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 N-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>",
                  "type": "module",
                  "displayName": "napi_get_element"
                },
                {
                  "textRaw": "napi_has_element",
                  "name": "napi_has_element",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "napiVersion": [
                      1
                    ],
                    "changes": []
                  },
                  "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 N-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>",
                  "type": "module",
                  "displayName": "napi_has_element"
                },
                {
                  "textRaw": "napi_delete_element",
                  "name": "napi_delete_element",
                  "meta": {
                    "added": [
                      "v8.2.0"
                    ],
                    "napiVersion": [
                      1
                    ],
                    "changes": []
                  },
                  "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 N-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>",
                  "type": "module",
                  "displayName": "napi_delete_element"
                },
                {
                  "textRaw": "napi_define_properties",
                  "name": "napi_define_properties",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "napiVersion": [
                      1
                    ],
                    "changes": []
                  },
                  "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 N-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=\"n-api.html#n_api_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.github.io/ecma262/#sec-ordinary-object-internal-methods-and-internal-slots-defineownproperty-p-desc\">Section 9.1.6</a> of the ECMA-262\nspecification).</p>",
                  "type": "module",
                  "displayName": "napi_define_properties"
                }
              ],
              "type": "module",
              "displayName": "Functions"
            }
          ],
          "type": "misc",
          "displayName": "Working with JavaScript properties"
        },
        {
          "textRaw": "Working with JavaScript functions",
          "name": "working_with_javascript_functions",
          "desc": "<p>N-API provides a set of APIs that allow JavaScript code to\ncall back into native code. N-API 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, N-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=\"n-api.html#n_api_napi_add_finalizer\"><code>napi_add_finalizer</code></a>.</p>",
          "modules": [
            {
              "textRaw": "napi_call_function",
              "name": "napi_call_function",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "napiVersion": [
                  1
                ],
                "changes": []
              },
              "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> object 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=\"n-api.html#n_api_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}\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>",
              "type": "module",
              "displayName": "napi_call_function"
            },
            {
              "textRaw": "napi_create_function",
              "name": "napi_create_function",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "napiVersion": [
                  1
                ],
                "changes": []
              },
              "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>: The name of the function encoded as UTF8. This is visible\nwithin 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.</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=\"n-api.html#n_api_napi_add_finalizer\"><code>napi_add_finalizer</code></a>.</p>\n<p>JavaScript <code>Function</code>s are described in <a href=\"https://tc39.github.io/ecma262/#sec-function-objects\">Section 19.2</a> of the ECMAScript\nLanguage Specification.</p>",
              "type": "module",
              "displayName": "napi_create_function"
            },
            {
              "textRaw": "napi_get_cb_info",
              "name": "napi_get_cb_info",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "napiVersion": [
                  1
                ],
                "changes": []
              },
              "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 size of the provided <code>argv</code> array and receives\nthe actual count of arguments.</li>\n<li><code>[out] argv</code>: Buffer to which the <code>napi_value</code> representing the arguments are\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>.</li>\n<li><code>[out] this</code>: Receives the JavaScript <code>this</code> argument for the call.</li>\n<li><code>[out] data</code>: Receives the data pointer for the callback.</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>",
              "type": "module",
              "displayName": "napi_get_cb_info"
            },
            {
              "textRaw": "napi_get_new_target",
              "name": "napi_get_new_target",
              "meta": {
                "added": [
                  "v8.6.0"
                ],
                "napiVersion": [
                  1
                ],
                "changes": []
              },
              "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>",
              "type": "module",
              "displayName": "napi_get_new_target"
            },
            {
              "textRaw": "napi_new_instance",
              "name": "napi_new_instance",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "napiVersion": [
                  1
                ],
                "changes": []
              },
              "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.</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 N-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>",
              "type": "module",
              "displayName": "napi_new_instance"
            }
          ],
          "type": "misc",
          "displayName": "Working with JavaScript functions"
        },
        {
          "textRaw": "Object wrap",
          "name": "object_wrap",
          "desc": "<p>N-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=\"n-api.html#n_api_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=\"n-api.html#n_api_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=\"n-api.html#n_api_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>",
          "modules": [
            {
              "textRaw": "napi_define_class",
              "name": "napi_define_class",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "napiVersion": [
                  1
                ],
                "changes": []
              },
              "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; this is\nnot required to be the same as the C++ class name, though it is recommended\nfor clarity.</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. (This should be a static method on the class, not an actual\nC++ constructor function.)</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 that corresponds to a C++ class, including:</p>\n<ul>\n<li>A JavaScript constructor function that has the class name and invokes the\nprovided C++ constructor callback.</li>\n<li>Properties on the constructor function corresponding to <em>static</em> data\nproperties, accessors, and methods of the C++ class (defined by\nproperty descriptors with the <code>napi_static</code> attribute).</li>\n<li>Properties on the constructor function's <code>prototype</code> object corresponding to\n<em>non-static</em> data properties, accessors, and methods of the C++ class\n(defined by property descriptors without the <code>napi_static</code> attribute).</li>\n</ul>\n<p>The C++ constructor callback should be a static method on the class that calls\nthe actual class constructor, then wraps the new C++ instance in a JavaScript\nobject, and returns the wrapper object. See <code>napi_wrap()</code> for details.</p>\n<p>The JavaScript constructor function returned from <a href=\"n-api.html#n_api_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 check whether provided values are instances of the class. In that\ncase, to prevent the function value from being garbage-collected, create a\npersistent reference to it using <a href=\"n-api.html#n_api_napi_create_reference\"><code>napi_create_reference</code></a> and ensure the\nreference 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=\"n-api.html#n_api_napi_add_finalizer\"><code>napi_add_finalizer</code></a>.</p>",
              "type": "module",
              "displayName": "napi_define_class"
            },
            {
              "textRaw": "napi_wrap",
              "name": "napi_wrap",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "napiVersion": [
                  1
                ],
                "changes": []
              },
              "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 is ready for garbage-collection.</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=\"n-api.html#n_api_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>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>",
              "type": "module",
              "displayName": "napi_wrap"
            },
            {
              "textRaw": "napi_unwrap",
              "name": "napi_unwrap",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "napiVersion": [
                  1
                ],
                "changes": []
              },
              "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>",
              "type": "module",
              "displayName": "napi_unwrap"
            },
            {
              "textRaw": "napi_remove_wrap",
              "name": "napi_remove_wrap",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "napiVersion": [
                  1
                ],
                "changes": []
              },
              "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>",
              "type": "module",
              "displayName": "napi_remove_wrap"
            },
            {
              "textRaw": "napi_add_finalizer",
              "name": "napi_add_finalizer",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "napiVersion": [
                  5
                ],
                "changes": []
              },
              "desc": "<pre><code class=\"language-c\">napi_status napi_add_finalizer(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 to which the native data will be\nattached.</li>\n<li><code>[in] native_object</code>: The native data that will be attached to the JavaScript\nobject.</li>\n<li><code>[in] finalize_cb</code>: Native callback that will be used to free the\nnative data when the JavaScript object is ready for garbage-collection.</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> is ready for garbage collection. This API is similar to\n<code>napi_wrap()</code> except that:</p>\n<ul>\n<li>the native data cannot be retrieved later using <code>napi_unwrap()</code>,</li>\n<li>nor can it be removed later using <code>napi_remove_wrap()</code>, and</li>\n<li>the API can be called multiple times with different data items in order to\nattach each of them to the JavaScript object, and</li>\n<li>the object manipulated by the API can be used with <code>napi_wrap()</code>.</li>\n</ul>\n<p><em>Caution</em>: The optional returned reference (if obtained) should be deleted via\n<a href=\"n-api.html#n_api_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>",
              "type": "module",
              "displayName": "napi_add_finalizer"
            }
          ],
          "type": "misc",
          "displayName": "Object wrap"
        },
        {
          "textRaw": "Simple asynchronous operations",
          "name": "simple_asynchronous_operations",
          "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>N-API provides an ABI-stable interface for these\nsupporting functions which covers the most common asynchronous use cases.</p>\n<p>N-API defines the <code>napi_async_work</code> structure which is used to manage\nasynchronous workers. Instances are created/deleted with\n<a href=\"n-api.html#n_api_napi_create_async_work\"><code>napi_create_async_work</code></a> and <a href=\"n-api.html#n_api_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 N-API calls\nthat could result in the execution of JavaScript or interaction with\nJavaScript objects. Most often, any code that needs to make N-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=\"n-api.html#n_api_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(napi_env env,\n                                  napi_async_work work);\n</code></pre>\n<p><a href=\"n-api.html#n_api_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=\"n-api.html#n_api_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",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "napiVersion": [
                  1
                ],
                "changes": [
                  {
                    "version": "v8.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/14697",
                    "description": "Added `async_resource` and `async_resource_name` parameters."
                  }
                ]
              },
              "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#async_hooks_init_asyncid_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.</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=\"n-api.html#n_api_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#async_hooks_type\"><code>async_hooks</code> documentation</a> for more information.</p>",
              "type": "module",
              "displayName": "napi_create_async_work"
            },
            {
              "textRaw": "napi_delete_async_work",
              "name": "napi_delete_async_work",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "napiVersion": [
                  1
                ],
                "changes": []
              },
              "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>",
              "type": "module",
              "displayName": "napi_delete_async_work"
            },
            {
              "textRaw": "napi_queue_async_work",
              "name": "napi_queue_async_work",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "napiVersion": [
                  1
                ],
                "changes": []
              },
              "desc": "<pre><code class=\"language-c\">napi_status napi_queue_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 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>",
              "type": "module",
              "displayName": "napi_queue_async_work"
            },
            {
              "textRaw": "napi_cancel_async_work",
              "name": "napi_cancel_async_work",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "napiVersion": [
                  1
                ],
                "changes": []
              },
              "desc": "<pre><code class=\"language-c\">napi_status napi_cancel_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 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>",
              "type": "module",
              "displayName": "napi_cancel_async_work"
            }
          ],
          "type": "misc",
          "displayName": "Simple asynchronous operations"
        },
        {
          "textRaw": "Custom asynchronous operations",
          "name": "custom_asynchronous_operations",
          "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",
              "meta": {
                "added": [
                  "v8.6.0"
                ],
                "napiVersion": [
                  1
                ],
                "changes": []
              },
              "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#async_hooks_init_asyncid_type_triggerasyncid_resource\"><code>init</code> hooks</a>.\nIn order to retain ABI compatibility with previous versions,\npassing <code>NULL</code> for <code>async_resource</code> will not result in an error, however,\nthis will result incorrect operation of async hooks for the\nnapi_async_context created. Potential issues include\nloss of async context when using the AsyncLocalStorage API.</li>\n<li><code>[in] async_resource_name</code>: Identifier for the kind of resource\nthat is being provided for diagnostic information exposed by the\n<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>",
              "type": "module",
              "displayName": "napi_async_init"
            },
            {
              "textRaw": "napi_async_destroy",
              "name": "napi_async_destroy",
              "meta": {
                "added": [
                  "v8.6.0"
                ],
                "napiVersion": [
                  1
                ],
                "changes": []
              },
              "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>",
              "type": "module",
              "displayName": "napi_async_destroy"
            },
            {
              "textRaw": "napi_make_callback",
              "name": "napi_make_callback",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "napiVersion": [
                  1
                ],
                "changes": [
                  {
                    "version": "v8.6.0",
                    "description": "Added `async_context` parameter."
                  }
                ]
              },
              "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=\"n-api.html#n_api_napi_async_init\"><code>napi_async_init</code></a>. However <code>NULL</code> is also allowed,\nwhich indicates the current async context (if any) is to be used\nfor the callback.</li>\n<li><code>[in] recv</code>: The <code>this</code> object 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.</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>",
              "type": "module",
              "displayName": "napi_make_callback"
            },
            {
              "textRaw": "napi_open_callback_scope",
              "name": "napi_open_callback_scope",
              "meta": {
                "added": [
                  "v9.6.0"
                ],
                "napiVersion": [
                  3
                ],
                "changes": []
              },
              "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#async_hooks_init_asyncid_type_triggerasyncid_resource\"><code>init</code> hooks</a>.</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=\"n-api.html#n_api_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 N-API calls. If there is no other script on\nthe stack the <a href=\"n-api.html#n_api_napi_open_callback_scope\"><code>napi_open_callback_scope</code></a> and\n<a href=\"n-api.html#n_api_napi_close_callback_scope\"><code>napi_close_callback_scope</code></a> functions can be used to open/close\nthe required scope.</p>",
              "type": "module",
              "displayName": "napi_open_callback_scope"
            },
            {
              "textRaw": "napi_close_callback_scope",
              "name": "napi_close_callback_scope",
              "meta": {
                "added": [
                  "v9.6.0"
                ],
                "napiVersion": [
                  3
                ],
                "changes": []
              },
              "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>",
              "type": "module",
              "displayName": "napi_close_callback_scope"
            }
          ],
          "type": "misc",
          "displayName": "Custom asynchronous operations"
        },
        {
          "textRaw": "Version management",
          "name": "version_management",
          "modules": [
            {
              "textRaw": "napi_get_node_version",
              "name": "napi_get_node_version",
              "meta": {
                "added": [
                  "v8.4.0"
                ],
                "napiVersion": [
                  1
                ],
                "changes": []
              },
              "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(napi_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#process_process_release\"><code>process.release.name</code></a>.</p>\n<p>The returned buffer is statically allocated and does not need to be freed.</p>",
              "type": "module",
              "displayName": "napi_get_node_version"
            },
            {
              "textRaw": "napi_get_version",
              "name": "napi_get_version",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "napiVersion": [
                  1
                ],
                "changes": []
              },
              "desc": "<pre><code class=\"language-c\">napi_status napi_get_version(napi_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 N-API supported.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API returns the highest N-API version supported by the\nNode.js runtime. N-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>",
              "type": "module",
              "displayName": "napi_get_version"
            }
          ],
          "type": "misc",
          "displayName": "Version management"
        },
        {
          "textRaw": "Memory management",
          "name": "memory_management",
          "modules": [
            {
              "textRaw": "napi_adjust_external_memory",
              "name": "napi_adjust_external_memory",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "napiVersion": [
                  1
                ],
                "changes": []
              },
              "desc": "<pre><code class=\"language-c\">NAPI_EXTERN napi_status napi_adjust_external_memory(napi_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</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This function gives V8 an indication of the amount of externally allocated\nmemory that is kept alive by JavaScript objects (i.e. a JavaScript object\nthat points to its own memory allocated by a native module). Registering\nexternally allocated memory will trigger global garbage collections more\noften than it would otherwise.</p>",
              "type": "module",
              "displayName": "napi_adjust_external_memory"
            }
          ],
          "type": "misc",
          "displayName": "Memory management"
        },
        {
          "textRaw": "Promises",
          "name": "promises",
          "desc": "<p>N-API provides facilities for creating <code>Promise</code> objects as described in\n<a href=\"https://tc39.github.io/ecma262/#sec-promise-objects\">Section 25.4</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",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "napiVersion": [
                  1
                ],
                "changes": []
              },
              "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>",
              "type": "module",
              "displayName": "napi_create_promise"
            },
            {
              "textRaw": "napi_resolve_deferred",
              "name": "napi_resolve_deferred",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "napiVersion": [
                  1
                ],
                "changes": []
              },
              "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>",
              "type": "module",
              "displayName": "napi_resolve_deferred"
            },
            {
              "textRaw": "napi_reject_deferred",
              "name": "napi_reject_deferred",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "napiVersion": [
                  1
                ],
                "changes": []
              },
              "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>",
              "type": "module",
              "displayName": "napi_reject_deferred"
            },
            {
              "textRaw": "napi_is_promise",
              "name": "napi_is_promise",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "napiVersion": [
                  1
                ],
                "changes": []
              },
              "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>",
              "type": "module",
              "displayName": "napi_is_promise"
            }
          ],
          "type": "misc",
          "displayName": "Promises"
        },
        {
          "textRaw": "Script execution",
          "name": "script_execution",
          "desc": "<p>N-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",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "napiVersion": [
                  1
                ],
                "changes": []
              },
              "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#modules_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#globals_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#globals_global\"><code>global</code></a> object.</li>\n<li>The value of <code>this</code> is <a href=\"globals.html#globals_global\"><code>global</code></a> within the script.</li>\n</ul>",
              "type": "module",
              "displayName": "napi_run_script"
            }
          ],
          "type": "misc",
          "displayName": "Script execution"
        },
        {
          "textRaw": "libuv event loop",
          "name": "libuv_event_loop",
          "desc": "<p>N-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",
              "meta": {
                "added": [
                  "v8.10.0",
                  "v9.3.0"
                ],
                "napiVersion": [
                  2
                ],
                "changes": []
              },
              "desc": "<pre><code class=\"language-c\">NAPI_EXTERN napi_status napi_get_uv_event_loop(napi_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>",
              "type": "module",
              "displayName": "napi_get_uv_event_loop"
            }
          ],
          "type": "misc",
          "displayName": "libuv event loop"
        },
        {
          "textRaw": "Asynchronous thread-safe function calls",
          "name": "asynchronous_thread-safe_function_calls",
          "desc": "<p>JavaScript functions can normally only be called from a native addon's main\nthread. If an addon creates additional threads, then N-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",
              "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>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\nN-API runs <code>call_js_cb</code> in a context appropriate for callbacks.</p>",
              "type": "module",
              "displayName": "Calling a thread-safe function"
            },
            {
              "textRaw": "Reference counting of thread-safe functions",
              "name": "reference_counting_of_thread-safe_functions",
              "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 make use of 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 aquisitions 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 make no\nfurther use of the thread-safe function because it is no longer guaranteed to\nbe allocated.</strong></p>",
              "type": "module",
              "displayName": "Reference counting of thread-safe functions"
            },
            {
              "textRaw": "Deciding whether to keep the process running",
              "name": "deciding_whether_to_keep_the_process_running",
              "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>",
              "type": "module",
              "displayName": "Deciding whether to keep the process running"
            },
            {
              "textRaw": "napi_create_threadsafe_function",
              "name": "napi_create_threadsafe_function",
              "meta": {
                "added": [
                  "v10.6.0"
                ],
                "napiVersion": [
                  4
                ],
                "changes": [
                  {
                    "version": "v12.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/27791",
                    "description": "Made `func` parameter optional with custom `call_js_cb`."
                  }
                ]
              },
              "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#async_hooks_init_asyncid_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.</li>\n<li><code>[out] result</code>: The asynchronous thread-safe JavaScript function.</li>\n</ul>",
              "type": "module",
              "displayName": "napi_create_threadsafe_function"
            },
            {
              "textRaw": "napi_get_threadsafe_function_context",
              "name": "napi_get_threadsafe_function_context",
              "meta": {
                "added": [
                  "v10.6.0"
                ],
                "napiVersion": [
                  4
                ],
                "changes": []
              },
              "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>",
              "type": "module",
              "displayName": "napi_get_threadsafe_function_context"
            },
            {
              "textRaw": "napi_call_threadsafe_function",
              "name": "napi_call_threadsafe_function",
              "meta": {
                "added": [
                  "v10.6.0"
                ],
                "napiVersion": [
                  4
                ],
                "changes": []
              },
              "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 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>",
              "type": "module",
              "displayName": "napi_call_threadsafe_function"
            },
            {
              "textRaw": "napi_acquire_threadsafe_function",
              "name": "napi_acquire_threadsafe_function",
              "meta": {
                "added": [
                  "v10.6.0"
                ],
                "napiVersion": [
                  4
                ],
                "changes": []
              },
              "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>",
              "type": "module",
              "displayName": "napi_acquire_threadsafe_function"
            },
            {
              "textRaw": "napi_release_threadsafe_function",
              "name": "napi_release_threadsafe_function",
              "meta": {
                "added": [
                  "v10.6.0"
                ],
                "napiVersion": [
                  4
                ],
                "changes": []
              },
              "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>",
              "type": "module",
              "displayName": "napi_release_threadsafe_function"
            },
            {
              "textRaw": "napi_ref_threadsafe_function",
              "name": "napi_ref_threadsafe_function",
              "meta": {
                "added": [
                  "v10.6.0"
                ],
                "napiVersion": [
                  4
                ],
                "changes": []
              },
              "desc": "<pre><code class=\"language-c\">NAPI_EXTERN napi_status\nnapi_ref_threadsafe_function(napi_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=\"http://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>",
              "type": "module",
              "displayName": "napi_ref_threadsafe_function"
            },
            {
              "textRaw": "napi_unref_threadsafe_function",
              "name": "napi_unref_threadsafe_function",
              "meta": {
                "added": [
                  "v10.6.0"
                ],
                "napiVersion": [
                  4
                ],
                "changes": []
              },
              "desc": "<pre><code class=\"language-c\">NAPI_EXTERN napi_status\nnapi_unref_threadsafe_function(napi_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=\"http://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>",
              "type": "module",
              "displayName": "napi_unref_threadsafe_function"
            }
          ],
          "type": "misc",
          "displayName": "Asynchronous thread-safe function calls"
        }
      ]
    },
    {
      "textRaw": "Command line options",
      "name": "Command line options",
      "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",
          "desc": "<p><code>node [options] [V8 options] [script.js | -e \"script\" | -] [--] [arguments]</code></p>\n<p><code>node inspect [script.js | -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><em>For more info about <code>node inspect</code>, please see the <a href=\"debugger.html\">debugger</a> documentation.</em></p>",
          "type": "misc",
          "displayName": "Synopsis"
        },
        {
          "textRaw": "Options",
          "name": "options",
          "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."
              }
            ]
          },
          "desc": "<p>All options, including V8 options, allow words to be separated by both\ndashes (<code>-</code>) or underscores (<code>_</code>).</p>\n<p>For example, <code>--pending-deprecation</code> is equivalent to <code>--pending_deprecation</code>.</p>",
          "modules": [
            {
              "textRaw": "`-`",
              "name": "`-`",
              "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 will be read from stdin, and the rest of the options\nare passed to that script.</p>",
              "type": "module",
              "displayName": "`-`"
            },
            {
              "textRaw": "`--`",
              "name": "`--`",
              "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 will be used as a script filename.</p>",
              "type": "module",
              "displayName": "`--`"
            },
            {
              "textRaw": "`--abort-on-uncaught-exception`",
              "name": "`--abort-on-uncaught-exception`",
              "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#process_process_setuncaughtexceptioncapturecallback_fn\"><code>process.setUncaughtExceptionCaptureCallback()</code></a> (and through usage of the\n<code>domain</code> module that uses it).</p>",
              "type": "module",
              "displayName": "`--abort-on-uncaught-exception`"
            },
            {
              "textRaw": "`--completion-bash`",
              "name": "`--completion-bash`",
              "meta": {
                "added": [
                  "v10.12.0"
                ],
                "changes": []
              },
              "desc": "<p>Print source-able bash completion script for Node.js.</p>\n<pre><code class=\"language-console\">$ node --completion-bash > node_bash_completion\n$ source node_bash_completion\n</code></pre>",
              "type": "module",
              "displayName": "`--completion-bash`"
            },
            {
              "textRaw": "`--cpu-prof`",
              "name": "`--cpu-prof`",
              "meta": {
                "added": [
                  "v12.0.0"
                ],
                "changes": []
              },
              "stability": 1,
              "stabilityText": "Experimental",
              "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 will be placed\nin the current working directory.</p>\n<p>If <code>--cpu-prof-name</code> is not specified, the generated profile will be\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>",
              "type": "module",
              "displayName": "`--cpu-prof`"
            },
            {
              "textRaw": "`--cpu-prof-dir`",
              "name": "`--cpu-prof-dir`",
              "meta": {
                "added": [
                  "v12.0.0"
                ],
                "changes": []
              },
              "stability": 1,
              "stabilityText": "Experimental",
              "desc": "<p>Specify the directory where the CPU profiles generated by <code>--cpu-prof</code> will\nbe placed.</p>",
              "type": "module",
              "displayName": "`--cpu-prof-dir`"
            },
            {
              "textRaw": "`--cpu-prof-interval`",
              "name": "`--cpu-prof-interval`",
              "meta": {
                "added": [
                  "v12.2.0"
                ],
                "changes": []
              },
              "stability": 1,
              "stabilityText": "Experimental",
              "desc": "<p>Specify the sampling interval in microseconds for the CPU profiles generated\nby <code>--cpu-prof</code>. The default is 1000 microseconds.</p>",
              "type": "module",
              "displayName": "`--cpu-prof-interval`"
            },
            {
              "textRaw": "`--cpu-prof-name`",
              "name": "`--cpu-prof-name`",
              "meta": {
                "added": [
                  "v12.0.0"
                ],
                "changes": []
              },
              "stability": 1,
              "stabilityText": "Experimental",
              "desc": "<p>Specify the file name of the CPU profile generated by <code>--cpu-prof</code>.</p>",
              "type": "module",
              "displayName": "`--cpu-prof-name`"
            },
            {
              "textRaw": "`--disable-proto=mode`",
              "name": "`--disable-proto=mode`",
              "desc": "<!--YAML\nadded: v12.17.0\n-->\n<p>Disable the <code>Object.prototype.__proto__</code> property. If <code>mode</code> is <code>delete</code>, the\nproperty will be removed entirely. If <code>mode</code> is <code>throw</code>, accesses to the\nproperty will throw an exception with the code <code>ERR_PROTO_ACCESS</code>.</p>",
              "type": "module",
              "displayName": "`--disable-proto=mode`"
            },
            {
              "textRaw": "`--disallow-code-generation-from-strings`",
              "name": "`--disallow-code-generation-from-strings`",
              "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>vm</code> module.</p>",
              "type": "module",
              "displayName": "`--disallow-code-generation-from-strings`"
            },
            {
              "textRaw": "`--enable-fips`",
              "name": "`--enable-fips`",
              "meta": {
                "added": [
                  "v6.0.0"
                ],
                "changes": []
              },
              "desc": "<p>Enable FIPS-compliant crypto at startup. (Requires Node.js to be built with\n<code>./configure --openssl-fips</code>.)</p>",
              "type": "module",
              "displayName": "`--enable-fips`"
            },
            {
              "textRaw": "`--enable-source-maps`",
              "name": "`--enable-source-maps`",
              "meta": {
                "added": [
                  "v12.12.0"
                ],
                "changes": []
              },
              "stability": 1,
              "stabilityText": "Experimental",
              "desc": "<p>Enable experimental Source Map v3 support for stack traces.</p>\n<p>Currently, overriding <code>Error.prepareStackTrace</code> is ignored when the\n<code>--enable-source-maps</code> flag is set.</p>",
              "type": "module",
              "displayName": "`--enable-source-maps`"
            },
            {
              "textRaw": "`--experimental-import-meta-resolve`",
              "name": "`--experimental-import-meta-resolve`",
              "meta": {
                "added": [
                  "v12.16.2"
                ],
                "changes": []
              },
              "desc": "<p>Enable experimental <code>import.meta.resolve()</code> support.</p>",
              "type": "module",
              "displayName": "`--experimental-import-meta-resolve`"
            },
            {
              "textRaw": "`--experimental-json-modules`",
              "name": "`--experimental-json-modules`",
              "meta": {
                "added": [
                  "v12.9.0"
                ],
                "changes": []
              },
              "desc": "<p>Enable experimental JSON support for the ES Module loader.</p>",
              "type": "module",
              "displayName": "`--experimental-json-modules`"
            },
            {
              "textRaw": "`--experimental-loader=module`",
              "name": "`--experimental-loader=module`",
              "meta": {
                "added": [
                  "v9.0.0"
                ],
                "changes": []
              },
              "desc": "<p>Specify the <code>module</code> of a custom <a href=\"esm.html#esm_experimental_loaders\">experimental ECMAScript Module loader</a>.\n<code>module</code> may be either a path to a file, or an ECMAScript Module name.</p>",
              "type": "module",
              "displayName": "`--experimental-loader=module`"
            },
            {
              "textRaw": "`--experimental-modules`",
              "name": "`--experimental-modules`",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": []
              },
              "desc": "<p>Enable latest experimental modules features (deprecated).</p>",
              "type": "module",
              "displayName": "`--experimental-modules`"
            },
            {
              "textRaw": "`--experimental-policy`",
              "name": "`--experimental-policy`",
              "meta": {
                "added": [
                  "v11.8.0"
                ],
                "changes": []
              },
              "desc": "<p>Use the specified file as a security policy.</p>",
              "type": "module",
              "displayName": "`--experimental-policy`"
            },
            {
              "textRaw": "`--experimental-repl-await`",
              "name": "`--experimental-repl-await`",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "desc": "<p>Enable experimental top-level <code>await</code> keyword support in REPL.</p>",
              "type": "module",
              "displayName": "`--experimental-repl-await`"
            },
            {
              "textRaw": "`--experimental-specifier-resolution=mode`",
              "name": "`--experimental-specifier-resolution=mode`",
              "meta": {
                "added": [
                  "v12.16.0"
                ],
                "changes": []
              },
              "desc": "<p>Sets the resolution algorithm for resolving ES module specifiers. Valid options\nare <code>explicit</code> and <code>node</code>.</p>\n<p>The default is <code>explicit</code>, which requires providing the full path to a\nmodule. The <code>node</code> mode will enable support for optional file extensions and\nthe ability to import a directory that has an index file.</p>\n<p>Please see <a href=\"esm.html#esm_customizing_esm_specifier_resolution_algorithm\">customizing ESM specifier resolution</a> for example usage.</p>",
              "type": "module",
              "displayName": "`--experimental-specifier-resolution=mode`"
            },
            {
              "textRaw": "`--experimental-vm-modules`",
              "name": "`--experimental-vm-modules`",
              "meta": {
                "added": [
                  "v9.6.0"
                ],
                "changes": []
              },
              "desc": "<p>Enable experimental ES Module support in the <code>vm</code> module.</p>",
              "type": "module",
              "displayName": "`--experimental-vm-modules`"
            },
            {
              "textRaw": "`--experimental-wasi-unstable-preview1`",
              "name": "`--experimental-wasi-unstable-preview1`",
              "meta": {
                "added": [
                  "v12.16.0"
                ],
                "changes": []
              },
              "desc": "<p>Enable experimental WebAssembly System Interface (WASI) support.</p>",
              "type": "module",
              "displayName": "`--experimental-wasi-unstable-preview1`"
            },
            {
              "textRaw": "`--experimental-wasm-modules`",
              "name": "`--experimental-wasm-modules`",
              "meta": {
                "added": [
                  "v12.3.0"
                ],
                "changes": []
              },
              "type": "module",
              "displayName": "`--experimental-wasm-modules`"
            },
            {
              "textRaw": "`--force-context-aware`",
              "name": "`--force-context-aware`",
              "meta": {
                "added": [
                  "v12.12.0"
                ],
                "changes": []
              },
              "desc": "<p>Disable loading native addons that are not <a href=\"addons.html#addons_context_aware_addons\">context-aware</a>.</p>\n<p>Enable experimental WebAssembly module support.</p>",
              "type": "module",
              "displayName": "`--force-context-aware`"
            },
            {
              "textRaw": "`--force-fips`",
              "name": "`--force-fips`",
              "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>",
              "type": "module",
              "displayName": "`--force-fips`"
            },
            {
              "textRaw": "`--frozen-intrinsics`",
              "name": "`--frozen-intrinsics`",
              "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>Support is currently only provided for the root context and no guarantees are\ncurrently provided that <code>global.Array</code> is indeed the default intrinsic\nreference. Code may break under this flag.</p>\n<p><code>--require</code> runs prior to freezing intrinsics in order to allow polyfills to\nbe added.</p>",
              "type": "module",
              "displayName": "`--frozen-intrinsics`"
            },
            {
              "textRaw": "`--heapsnapshot-signal=signal`",
              "name": "`--heapsnapshot-signal=signal`",
              "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>",
              "type": "module",
              "displayName": "`--heapsnapshot-signal=signal`"
            },
            {
              "textRaw": "`--heap-prof`",
              "name": "`--heap-prof`",
              "meta": {
                "added": [
                  "v12.4.0"
                ],
                "changes": []
              },
              "stability": 1,
              "stabilityText": "Experimental",
              "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 will be placed\nin the current working directory.</p>\n<p>If <code>--heap-prof-name</code> is not specified, the generated profile will be\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>",
              "type": "module",
              "displayName": "`--heap-prof`"
            },
            {
              "textRaw": "`--heap-prof-dir`",
              "name": "`--heap-prof-dir`",
              "meta": {
                "added": [
                  "v12.4.0"
                ],
                "changes": []
              },
              "stability": 1,
              "stabilityText": "Experimental",
              "desc": "<p>Specify the directory where the heap profiles generated by <code>--heap-prof</code> will\nbe placed.</p>",
              "type": "module",
              "displayName": "`--heap-prof-dir`"
            },
            {
              "textRaw": "`--heap-prof-interval`",
              "name": "`--heap-prof-interval`",
              "meta": {
                "added": [
                  "v12.4.0"
                ],
                "changes": []
              },
              "stability": 1,
              "stabilityText": "Experimental",
              "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>",
              "type": "module",
              "displayName": "`--heap-prof-interval`"
            },
            {
              "textRaw": "`--heap-prof-name`",
              "name": "`--heap-prof-name`",
              "meta": {
                "added": [
                  "v12.4.0"
                ],
                "changes": []
              },
              "stability": 1,
              "stabilityText": "Experimental",
              "desc": "<p>Specify the file name of the heap profile generated by <code>--heap-prof</code>.</p>",
              "type": "module",
              "displayName": "`--heap-prof-name`"
            },
            {
              "textRaw": "`--http-parser=library`",
              "name": "`--http-parser=library`",
              "meta": {
                "added": [
                  "v11.4.0"
                ],
                "changes": []
              },
              "desc": "<p>Chooses an HTTP parser library. Available values are:</p>\n<ul>\n<li><code>llhttp</code> for <a href=\"https://llhttp.org/\">https://llhttp.org/</a></li>\n<li><code>legacy</code> for <a href=\"https://github.com/nodejs/http-parser\">https://github.com/nodejs/http-parser</a></li>\n</ul>\n<p>The default is <code>llhttp</code>, unless otherwise specified when building Node.js.</p>\n<p>This flag exists to aid in experimentation with the internal implementation of\nthe Node.js http parser.\nThis flag is likely to become a no-op and removed at some point in the future.</p>",
              "type": "module",
              "displayName": "`--http-parser=library`"
            },
            {
              "textRaw": "`--http-server-default-timeout=milliseconds`",
              "name": "`--http-server-default-timeout=milliseconds`",
              "meta": {
                "added": [
                  "v12.4.0"
                ],
                "changes": []
              },
              "desc": "<p>Overrides the default value of <code>http</code>, <code>https</code> and <code>http2</code> server socket\ntimeout. Setting the value to 0 disables server socket timeout. Unless\nprovided, http server sockets timeout after 120s (2 minutes). Programmatic\nsetting of the timeout takes precedence over the value set through this\nflag.</p>",
              "type": "module",
              "displayName": "`--http-server-default-timeout=milliseconds`"
            },
            {
              "textRaw": "`--icu-data-dir=file`",
              "name": "`--icu-data-dir=file`",
              "meta": {
                "added": [
                  "v0.11.15"
                ],
                "changes": []
              },
              "desc": "<p>Specify ICU data load path. (Overrides <code>NODE_ICU_DATA</code>.)</p>",
              "type": "module",
              "displayName": "`--icu-data-dir=file`"
            },
            {
              "textRaw": "`--input-type=type`",
              "name": "`--input-type=type`",
              "meta": {
                "added": [
                  "v12.0.0"
                ],
                "changes": []
              },
              "desc": "<p>This configures Node.js to interpret string input as CommonJS or as an ES\nmodule. String input is input via <code>--eval</code>, <code>--print</code>, or <code>STDIN</code>.</p>\n<p>Valid values are <code>\"commonjs\"</code> and <code>\"module\"</code>. The default is <code>\"commonjs\"</code>.</p>",
              "type": "module",
              "displayName": "`--input-type=type`"
            },
            {
              "textRaw": "`--inspect-brk[=[host:]port]`",
              "name": "`--inspect-brk[=[host:]port]`",
              "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>.</p>",
              "type": "module",
              "displayName": "`--inspect-brk[=[host:]port]`"
            },
            {
              "textRaw": "`--inspect-port=[host:]port`",
              "name": "`--inspect-port=[host:]port`",
              "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.</p>\n<p>Default host is <code>127.0.0.1</code>.</p>\n<p>See the <a href=\"cli.html#inspector_security\">security warning</a> below regarding the <code>host</code>\nparameter usage.</p>",
              "type": "module",
              "displayName": "`--inspect-port=[host:]port`"
            },
            {
              "textRaw": "`--inspect[=[host:]port]`",
              "name": "`--inspect[=[host:]port]`",
              "meta": {
                "added": [
                  "v6.3.0"
                ],
                "changes": []
              },
              "desc": "<p>Activate inspector on <code>host:port</code>. Default is <code>127.0.0.1:9229</code>.</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>.</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",
                  "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>",
                  "type": "module",
                  "displayName": "Warning: binding inspector to a public IP:port combination is insecure"
                }
              ],
              "type": "module",
              "displayName": "`--inspect[=[host:]port]`"
            },
            {
              "textRaw": "`--inspect-publish-uid=stderr,http`",
              "name": "`--inspect-publish-uid=stderr,http`",
              "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>",
              "type": "module",
              "displayName": "`--inspect-publish-uid=stderr,http`"
            },
            {
              "textRaw": "`--insecure-http-parser`",
              "name": "`--insecure-http-parser`",
              "meta": {
                "added": [
                  "v12.15.0"
                ],
                "changes": []
              },
              "desc": "<p>Use an insecure HTTP parser that accepts invalid HTTP headers. This may allow\ninteroperability with non-conformant HTTP implementations. It may also allow\nrequest smuggling and other HTTP attacks that rely on invalid headers being\naccepted. Avoid using this option.</p>",
              "type": "module",
              "displayName": "`--insecure-http-parser`"
            },
            {
              "textRaw": "`--jitless`",
              "name": "`--jitless`",
              "meta": {
                "added": [
                  "v12.0.0"
                ],
                "changes": []
              },
              "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>\n<p>This flag is inherited from V8 and is subject to change upstream. It may\ndisappear in a non-semver-major release.</p>",
              "type": "module",
              "displayName": "`--jitless`"
            },
            {
              "textRaw": "`--max-http-header-size=size`",
              "name": "`--max-http-header-size=size`",
              "meta": {
                "added": [
                  "v11.6.0"
                ],
                "changes": []
              },
              "desc": "<p>Specify the maximum size, in bytes, of HTTP headers. Defaults to 8KB.</p>",
              "type": "module",
              "displayName": "`--max-http-header-size=size`"
            },
            {
              "textRaw": "`--napi-modules`",
              "name": "`--napi-modules`",
              "meta": {
                "added": [
                  "v7.10.0"
                ],
                "changes": []
              },
              "desc": "<p>This option is a no-op. It is kept for compatibility.</p>",
              "type": "module",
              "displayName": "`--napi-modules`"
            },
            {
              "textRaw": "`--no-deprecation`",
              "name": "`--no-deprecation`",
              "meta": {
                "added": [
                  "v0.8.0"
                ],
                "changes": []
              },
              "desc": "<p>Silence deprecation warnings.</p>",
              "type": "module",
              "displayName": "`--no-deprecation`"
            },
            {
              "textRaw": "`--no-force-async-hooks-checks`",
              "name": "`--no-force-async-hooks-checks`",
              "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>",
              "type": "module",
              "displayName": "`--no-force-async-hooks-checks`"
            },
            {
              "textRaw": "`--no-warnings`",
              "name": "`--no-warnings`",
              "meta": {
                "added": [
                  "v6.0.0"
                ],
                "changes": []
              },
              "desc": "<p>Silence all process warnings (including deprecations).</p>",
              "type": "module",
              "displayName": "`--no-warnings`"
            },
            {
              "textRaw": "`--openssl-config=file`",
              "name": "`--openssl-config=file`",
              "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 with\n<code>./configure --openssl-fips</code>.</p>",
              "type": "module",
              "displayName": "`--openssl-config=file`"
            },
            {
              "textRaw": "`--pending-deprecation`",
              "name": "`--pending-deprecation`",
              "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>",
              "type": "module",
              "displayName": "`--pending-deprecation`"
            },
            {
              "textRaw": "`--policy-integrity=sri`",
              "name": "`--policy-integrity=sri`",
              "meta": {
                "added": [
                  "v12.7.0"
                ],
                "changes": []
              },
              "stability": 1,
              "stabilityText": "Experimental",
              "desc": "<p>Instructs Node.js to error prior to running any code if the policy does not have\nthe specified integrity. It expects a <a href=\"https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity\">Subresource Integrity</a> string as a\nparameter.</p>",
              "type": "module",
              "displayName": "`--policy-integrity=sri`"
            },
            {
              "textRaw": "`--preserve-symlinks`",
              "name": "`--preserve-symlinks`",
              "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>",
              "type": "module",
              "displayName": "`--preserve-symlinks`"
            },
            {
              "textRaw": "`--preserve-symlinks-main`",
              "name": "`--preserve-symlinks-main`",
              "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>; it\nis expected that <code>--preserve-symlinks-main</code> will be used in addition to\n<code>--preserve-symlinks</code> when it is not desirable to follow symlinks before\nresolving relative paths.</p>\n<p>See <code>--preserve-symlinks</code> for more information.</p>",
              "type": "module",
              "displayName": "`--preserve-symlinks-main`"
            },
            {
              "textRaw": "`--prof`",
              "name": "`--prof`",
              "meta": {
                "added": [
                  "v2.0.0"
                ],
                "changes": []
              },
              "desc": "<p>Generate V8 profiler output.</p>",
              "type": "module",
              "displayName": "`--prof`"
            },
            {
              "textRaw": "`--prof-process`",
              "name": "`--prof-process`",
              "meta": {
                "added": [
                  "v5.2.0"
                ],
                "changes": []
              },
              "desc": "<p>Process V8 profiler output generated using the V8 option <code>--prof</code>.</p>",
              "type": "module",
              "displayName": "`--prof-process`"
            },
            {
              "textRaw": "`--redirect-warnings=file`",
              "name": "`--redirect-warnings=file`",
              "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>",
              "type": "module",
              "displayName": "`--redirect-warnings=file`"
            },
            {
              "textRaw": "`--report-compact`",
              "name": "`--report-compact`",
              "meta": {
                "added": [
                  "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>",
              "type": "module",
              "displayName": "`--report-compact`"
            },
            {
              "textRaw": "`--report-directory=directory`",
              "name": "`--report-directory=directory`",
              "meta": {
                "added": [
                  "v11.8.0"
                ],
                "changes": [
                  {
                    "version": "v12.17.0",
                    "pr-url": "https://github.com/nodejs/node/pull/32242",
                    "description": "This option is no longer considered 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>",
              "type": "module",
              "displayName": "`--report-directory=directory`"
            },
            {
              "textRaw": "`--report-filename=filename`",
              "name": "`--report-filename=filename`",
              "meta": {
                "added": [
                  "v11.8.0"
                ],
                "changes": [
                  {
                    "version": "v12.17.0",
                    "pr-url": "https://github.com/nodejs/node/pull/32242",
                    "description": "This option is no longer considered 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>",
              "type": "module",
              "displayName": "`--report-filename=filename`"
            },
            {
              "textRaw": "`--report-on-fatalerror`",
              "name": "`--report-on-fatalerror`",
              "meta": {
                "added": [
                  "v11.8.0"
                ],
                "changes": [
                  {
                    "version": "v12.17.0",
                    "pr-url": "https://github.com/nodejs/node/pull/32496",
                    "description": "This option is no longer considered 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>",
              "type": "module",
              "displayName": "`--report-on-fatalerror`"
            },
            {
              "textRaw": "`--report-on-signal`",
              "name": "`--report-on-signal`",
              "meta": {
                "added": [
                  "v11.8.0"
                ],
                "changes": [
                  {
                    "version": "v12.17.0",
                    "pr-url": "https://github.com/nodejs/node/pull/32242",
                    "description": "This option is no longer considered 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>",
              "type": "module",
              "displayName": "`--report-on-signal`"
            },
            {
              "textRaw": "`--report-signal=signal`",
              "name": "`--report-signal=signal`",
              "meta": {
                "added": [
                  "v11.8.0"
                ],
                "changes": [
                  {
                    "version": "v12.17.0",
                    "pr-url": "https://github.com/nodejs/node/pull/32242",
                    "description": "This option is no longer considered 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>",
              "type": "module",
              "displayName": "`--report-signal=signal`"
            },
            {
              "textRaw": "`--report-uncaught-exception`",
              "name": "`--report-uncaught-exception`",
              "meta": {
                "added": [
                  "v11.8.0"
                ],
                "changes": [
                  {
                    "version": "v12.17.0",
                    "pr-url": "https://github.com/nodejs/node/pull/32242",
                    "description": "This option is no longer considered 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 on uncaught exceptions. Useful when inspecting\nthe JavaScript stack in conjunction with native stack and other runtime\nenvironment data.</p>",
              "type": "module",
              "displayName": "`--report-uncaught-exception`"
            },
            {
              "textRaw": "`--throw-deprecation`",
              "name": "`--throw-deprecation`",
              "meta": {
                "added": [
                  "v0.11.14"
                ],
                "changes": []
              },
              "desc": "<p>Throw errors for deprecations.</p>",
              "type": "module",
              "displayName": "`--throw-deprecation`"
            },
            {
              "textRaw": "`--title=title`",
              "name": "`--title=title`",
              "meta": {
                "added": [
                  "v10.7.0"
                ],
                "changes": []
              },
              "desc": "<p>Set <code>process.title</code> on startup.</p>",
              "type": "module",
              "displayName": "`--title=title`"
            },
            {
              "textRaw": "`--tls-cipher-list=list`",
              "name": "`--tls-cipher-list=list`",
              "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>",
              "type": "module",
              "displayName": "`--tls-cipher-list=list`"
            },
            {
              "textRaw": "`--tls-keylog=file`",
              "name": "`--tls-keylog=file`",
              "meta": {
                "added": [
                  "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>",
              "type": "module",
              "displayName": "`--tls-keylog=file`"
            },
            {
              "textRaw": "`--tls-max-v1.2`",
              "name": "`--tls-max-v1.2`",
              "meta": {
                "added": [
                  "v12.0.0"
                ],
                "changes": []
              },
              "desc": "<p>Set <a href=\"tls.html#tls_tls_default_max_version\"><code>tls.DEFAULT_MAX_VERSION</code></a> to 'TLSv1.2'. Use to disable support for\nTLSv1.3.</p>",
              "type": "module",
              "displayName": "`--tls-max-v1.2`"
            },
            {
              "textRaw": "`--tls-max-v1.3`",
              "name": "`--tls-max-v1.3`",
              "meta": {
                "added": [
                  "v12.0.0"
                ],
                "changes": []
              },
              "desc": "<p>Set default <a href=\"tls.html#tls_tls_default_max_version\"><code>tls.DEFAULT_MAX_VERSION</code></a> to 'TLSv1.3'. Use to enable support\nfor TLSv1.3.</p>",
              "type": "module",
              "displayName": "`--tls-max-v1.3`"
            },
            {
              "textRaw": "`--tls-min-v1.0`",
              "name": "`--tls-min-v1.0`",
              "meta": {
                "added": [
                  "v12.0.0"
                ],
                "changes": []
              },
              "desc": "<p>Set default <a href=\"tls.html#tls_tls_default_min_version\"><code>tls.DEFAULT_MIN_VERSION</code></a> to 'TLSv1'. Use for compatibility with\nold TLS clients or servers.</p>",
              "type": "module",
              "displayName": "`--tls-min-v1.0`"
            },
            {
              "textRaw": "`--tls-min-v1.1`",
              "name": "`--tls-min-v1.1`",
              "meta": {
                "added": [
                  "v12.0.0"
                ],
                "changes": []
              },
              "desc": "<p>Set default <a href=\"tls.html#tls_tls_default_min_version\"><code>tls.DEFAULT_MIN_VERSION</code></a> to 'TLSv1.1'. Use for compatibility\nwith old TLS clients or servers.</p>",
              "type": "module",
              "displayName": "`--tls-min-v1.1`"
            },
            {
              "textRaw": "`--tls-min-v1.2`",
              "name": "`--tls-min-v1.2`",
              "meta": {
                "added": [
                  "v12.2.0"
                ],
                "changes": []
              },
              "desc": "<p>Set default <a href=\"tls.html#tls_tls_default_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>",
              "type": "module",
              "displayName": "`--tls-min-v1.2`"
            },
            {
              "textRaw": "`--tls-min-v1.3`",
              "name": "`--tls-min-v1.3`",
              "meta": {
                "added": [
                  "v12.0.0"
                ],
                "changes": []
              },
              "desc": "<p>Set default <a href=\"tls.html#tls_tls_default_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>",
              "type": "module",
              "displayName": "`--tls-min-v1.3`"
            },
            {
              "textRaw": "`--trace-deprecation`",
              "name": "`--trace-deprecation`",
              "meta": {
                "added": [
                  "v0.8.0"
                ],
                "changes": []
              },
              "desc": "<p>Print stack traces for deprecations.</p>",
              "type": "module",
              "displayName": "`--trace-deprecation`"
            },
            {
              "textRaw": "`--trace-event-categories`",
              "name": "`--trace-event-categories`",
              "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>",
              "type": "module",
              "displayName": "`--trace-event-categories`"
            },
            {
              "textRaw": "`--trace-event-file-pattern`",
              "name": "`--trace-event-file-pattern`",
              "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>",
              "type": "module",
              "displayName": "`--trace-event-file-pattern`"
            },
            {
              "textRaw": "`--trace-events-enabled`",
              "name": "`--trace-events-enabled`",
              "meta": {
                "added": [
                  "v7.7.0"
                ],
                "changes": []
              },
              "desc": "<p>Enables the collection of trace event tracing information.</p>",
              "type": "module",
              "displayName": "`--trace-events-enabled`"
            },
            {
              "textRaw": "`--trace-exit`",
              "name": "`--trace-exit`",
              "meta": {
                "added": [
                  "v12.16.0"
                ],
                "changes": []
              },
              "desc": "<p>Prints a stack trace whenever an environment is exited proactively,\ni.e. invoking <code>process.exit()</code>.</p>",
              "type": "module",
              "displayName": "`--trace-exit`"
            },
            {
              "textRaw": "`--trace-sigint`",
              "name": "`--trace-sigint`",
              "meta": {
                "added": [
                  "v12.17.0"
                ],
                "changes": []
              },
              "desc": "<p>Prints a stack trace on SIGINT.</p>",
              "type": "module",
              "displayName": "`--trace-sigint`"
            },
            {
              "textRaw": "`--trace-sync-io`",
              "name": "`--trace-sync-io`",
              "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>",
              "type": "module",
              "displayName": "`--trace-sync-io`"
            },
            {
              "textRaw": "`--trace-tls`",
              "name": "`--trace-tls`",
              "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>",
              "type": "module",
              "displayName": "`--trace-tls`"
            },
            {
              "textRaw": "`--trace-uncaught`",
              "name": "`--trace-uncaught`",
              "meta": {
                "added": [
                  "v12.16.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>",
              "type": "module",
              "displayName": "`--trace-uncaught`"
            },
            {
              "textRaw": "`--trace-warnings`",
              "name": "`--trace-warnings`",
              "meta": {
                "added": [
                  "v6.0.0"
                ],
                "changes": []
              },
              "desc": "<p>Print stack traces for process warnings (including deprecations).</p>",
              "type": "module",
              "displayName": "`--trace-warnings`"
            },
            {
              "textRaw": "`--track-heap-objects`",
              "name": "`--track-heap-objects`",
              "meta": {
                "added": [
                  "v2.4.0"
                ],
                "changes": []
              },
              "desc": "<p>Track heap object allocations for heap snapshots.</p>",
              "type": "module",
              "displayName": "`--track-heap-objects`"
            },
            {
              "textRaw": "`--unhandled-rejections=mode`",
              "name": "`--unhandled-rejections=mode`",
              "meta": {
                "added": [
                  "v12.0.0"
                ],
                "changes": []
              },
              "desc": "<p>By default all unhandled rejections trigger a warning plus a deprecation warning\nfor the very first unhandled rejection in case no <a href=\"process.html#process_event_unhandledrejection\"><code>unhandledRejection</code></a> hook\nis used.</p>\n<p>Using this flag allows to change what should happen when an unhandled rejection\noccurs. One of three modes can be chosen:</p>\n<ul>\n<li><code>strict</code>: Raise the unhandled rejection as an uncaught exception.</li>\n<li><code>warn</code>: Always trigger a warning, no matter if the <a href=\"process.html#process_event_unhandledrejection\"><code>unhandledRejection</code></a>\nhook is set or not but do not print the deprecation warning.</li>\n<li><code>none</code>: Silence all warnings.</li>\n</ul>",
              "type": "module",
              "displayName": "`--unhandled-rejections=mode`"
            },
            {
              "textRaw": "`--use-bundled-ca`, `--use-openssl-ca`",
              "name": "`--use-bundled-ca`,_`--use-openssl-ca`",
              "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>",
              "type": "module",
              "displayName": "`--use-bundled-ca`, `--use-openssl-ca`"
            },
            {
              "textRaw": "`--use-largepages=mode`",
              "name": "`--use-largepages=mode`",
              "meta": {
                "added": [
                  "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>",
              "type": "module",
              "displayName": "`--use-largepages=mode`"
            },
            {
              "textRaw": "`--v8-options`",
              "name": "`--v8-options`",
              "meta": {
                "added": [
                  "v0.1.3"
                ],
                "changes": []
              },
              "desc": "<p>Print V8 command line options.</p>",
              "type": "module",
              "displayName": "`--v8-options`"
            },
            {
              "textRaw": "`--v8-pool-size=num`",
              "name": "`--v8-pool-size=num`",
              "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 V8 will choose an appropriate size of the thread pool based\non the number of online processors.</p>\n<p>If the value provided is larger than V8's maximum, then the largest value\nwill be chosen.</p>",
              "type": "module",
              "displayName": "`--v8-pool-size=num`"
            },
            {
              "textRaw": "`--zero-fill-buffers`",
              "name": "`--zero-fill-buffers`",
              "meta": {
                "added": [
                  "v6.0.0"
                ],
                "changes": []
              },
              "desc": "<p>Automatically zero-fills all newly allocated <a href=\"buffer.html#buffer_class_buffer\"><code>Buffer</code></a> and <a href=\"buffer.html#buffer_class_slowbuffer\"><code>SlowBuffer</code></a>\ninstances.</p>",
              "type": "module",
              "displayName": "`--zero-fill-buffers`"
            },
            {
              "textRaw": "`-c`, `--check`",
              "name": "`-c`,_`--check`",
              "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>",
              "type": "module",
              "displayName": "`-c`, `--check`"
            },
            {
              "textRaw": "`-e`, `--eval \"script\"`",
              "name": "`-e`,_`--eval_\"script\"`",
              "meta": {
                "added": [
                  "v0.5.2"
                ],
                "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>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>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>",
              "type": "module",
              "displayName": "`-e`, `--eval \"script\"`"
            },
            {
              "textRaw": "`-h`, `--help`",
              "name": "`-h`,_`--help`",
              "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>",
              "type": "module",
              "displayName": "`-h`, `--help`"
            },
            {
              "textRaw": "`-i`, `--interactive`",
              "name": "`-i`,_`--interactive`",
              "meta": {
                "added": [
                  "v0.7.7"
                ],
                "changes": []
              },
              "desc": "<p>Opens the REPL even if stdin does not appear to be a terminal.</p>",
              "type": "module",
              "displayName": "`-i`, `--interactive`"
            },
            {
              "textRaw": "`-p`, `--print \"script\"`",
              "name": "`-p`,_`--print_\"script\"`",
              "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>",
              "type": "module",
              "displayName": "`-p`, `--print \"script\"`"
            },
            {
              "textRaw": "`-r`, `--require module`",
              "name": "`-r`,_`--require_module`",
              "meta": {
                "added": [
                  "v1.6.0"
                ],
                "changes": []
              },
              "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>",
              "type": "module",
              "displayName": "`-r`, `--require module`"
            },
            {
              "textRaw": "`-v`, `--version`",
              "name": "`-v`,_`--version`",
              "meta": {
                "added": [
                  "v0.1.3"
                ],
                "changes": []
              },
              "desc": "<p>Print node's version.</p>",
              "type": "module",
              "displayName": "`-v`, `--version`"
            }
          ],
          "type": "misc",
          "displayName": "Options"
        },
        {
          "textRaw": "Environment variables",
          "name": "environment_variables",
          "modules": [
            {
              "textRaw": "`NODE_DEBUG=module[,…]`",
              "name": "`node_debug=module[,…]`",
              "meta": {
                "added": [
                  "v0.1.32"
                ],
                "changes": []
              },
              "desc": "<p><code>','</code>-separated list of core modules that should print debug information.</p>",
              "type": "module",
              "displayName": "`NODE_DEBUG=module[,…]`"
            },
            {
              "textRaw": "`NODE_DEBUG_NATIVE=module[,…]`",
              "name": "`node_debug_native=module[,…]`",
              "desc": "<p><code>','</code>-separated list of core C++ modules that should print debug information.</p>",
              "type": "module",
              "displayName": "`NODE_DEBUG_NATIVE=module[,…]`"
            },
            {
              "textRaw": "`NODE_DISABLE_COLORS=1`",
              "name": "`node_disable_colors=1`",
              "meta": {
                "added": [
                  "v0.3.0"
                ],
                "changes": []
              },
              "desc": "<p>When set, colors will not be used in the REPL.</p>",
              "type": "module",
              "displayName": "`NODE_DISABLE_COLORS=1`"
            },
            {
              "textRaw": "`NODE_EXTRA_CA_CERTS=file`",
              "name": "`node_extra_ca_certs=file`",
              "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#process_process_emitwarning_warning_type_code_ctor\"><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>",
              "type": "module",
              "displayName": "`NODE_EXTRA_CA_CERTS=file`"
            },
            {
              "textRaw": "`NODE_ICU_DATA=file`",
              "name": "`node_icu_data=file`",
              "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>",
              "type": "module",
              "displayName": "`NODE_ICU_DATA=file`"
            },
            {
              "textRaw": "`NODE_NO_WARNINGS=1`",
              "name": "`node_no_warnings=1`",
              "meta": {
                "added": [
                  "v6.11.0"
                ],
                "changes": []
              },
              "desc": "<p>When set to <code>1</code>, process warnings are silenced.</p>",
              "type": "module",
              "displayName": "`NODE_NO_WARNINGS=1`"
            },
            {
              "textRaw": "`NODE_OPTIONS=options...`",
              "name": "`node_options=options...`",
              "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>In case an option value happens to contain a space (for example a path listed\nin <code>--require</code>), it must be escaped using double quotes. For example:</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:</p>\n<!-- node-options-node start -->\n<ul>\n<li><code>--disable-proto</code></li>\n<li><code>--enable-fips</code></li>\n<li><code>--enable-source-maps</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-policy</code></li>\n<li><code>--experimental-repl-await</code></li>\n<li><code>--experimental-specifier-resolution</code></li>\n<li><code>--experimental-vm-modules</code></li>\n<li><code>--experimental-wasi-unstable-preview1</code></li>\n<li><code>--experimental-wasm-modules</code></li>\n<li><code>--force-context-aware</code></li>\n<li><code>--force-fips</code></li>\n<li><code>--frozen-intrinsics</code></li>\n<li><code>--heapsnapshot-signal</code></li>\n<li><code>--http-parser</code></li>\n<li><code>--http-server-default-timeout</code></li>\n<li><code>--icu-data-dir</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</code></li>\n<li><code>--max-http-header-size</code></li>\n<li><code>--napi-modules</code></li>\n<li><code>--no-deprecation</code></li>\n<li><code>--no-force-async-hooks-checks</code></li>\n<li><code>--no-warnings</code></li>\n<li><code>--openssl-config</code></li>\n<li><code>--pending-deprecation</code></li>\n<li><code>--policy-integrity</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-directory</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</code>, <code>-r</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-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-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-largepages</code></li>\n<li><code>--use-openssl-ca</code></li>\n<li><code>--v8-pool-size</code></li>\n<li>\n<p><code>--zero-fill-buffers</code></p>\n<!-- node-options-node end -->\n</li>\n</ul>\n<p>V8 options that are allowed are:</p>\n<!-- node-options-v8 start -->\n<ul>\n<li><code>--abort-on-uncaught-exception</code></li>\n<li><code>--disallow-code-generation-from-strings</code></li>\n<li><code>--huge-max-old-generation-size</code></li>\n<li><code>--interpreted-frames-native-stack</code></li>\n<li><code>--jitless</code></li>\n<li><code>--max-old-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>\n<p><code>--stack-trace-limit</code></p>\n<!-- node-options-v8 end -->\n</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>",
              "type": "module",
              "displayName": "`NODE_OPTIONS=options...`"
            },
            {
              "textRaw": "`NODE_PATH=path[:…]`",
              "name": "`node_path=path[:…]`",
              "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>",
              "type": "module",
              "displayName": "`NODE_PATH=path[:…]`"
            },
            {
              "textRaw": "`NODE_PENDING_DEPRECATION=1`",
              "name": "`node_pending_deprecation=1`",
              "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>",
              "type": "module",
              "displayName": "`NODE_PENDING_DEPRECATION=1`"
            },
            {
              "textRaw": "`NODE_PENDING_PIPE_INSTANCES=instances`",
              "name": "`node_pending_pipe_instances=instances`",
              "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>",
              "type": "module",
              "displayName": "`NODE_PENDING_PIPE_INSTANCES=instances`"
            },
            {
              "textRaw": "`NODE_PRESERVE_SYMLINKS=1`",
              "name": "`node_preserve_symlinks=1`",
              "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>",
              "type": "module",
              "displayName": "`NODE_PRESERVE_SYMLINKS=1`"
            },
            {
              "textRaw": "`NODE_REDIRECT_WARNINGS=file`",
              "name": "`node_redirect_warnings=file`",
              "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>",
              "type": "module",
              "displayName": "`NODE_REDIRECT_WARNINGS=file`"
            },
            {
              "textRaw": "`NODE_REPL_HISTORY=file`",
              "name": "`node_repl_history=file`",
              "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>",
              "type": "module",
              "displayName": "`NODE_REPL_HISTORY=file`"
            },
            {
              "textRaw": "`NODE_REPL_EXTERNAL_MODULE=file`",
              "name": "`node_repl_external_module=file`",
              "meta": {
                "added": [
                  "v12.16.0"
                ],
                "changes": []
              },
              "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>",
              "type": "module",
              "displayName": "`NODE_REPL_EXTERNAL_MODULE=file`"
            },
            {
              "textRaw": "`NODE_TLS_REJECT_UNAUTHORIZED=value`",
              "name": "`node_tls_reject_unauthorized=value`",
              "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>",
              "type": "module",
              "displayName": "`NODE_TLS_REJECT_UNAUTHORIZED=value`"
            },
            {
              "textRaw": "`NODE_V8_COVERAGE=dir`",
              "name": "`node_v8_coverage=dir`",
              "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://sourcemaps.info/spec.html\">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",
                  "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>",
                  "type": "module",
                  "displayName": "Coverage output"
                },
                {
                  "textRaw": "Source map cache",
                  "name": "source_map_cache",
                  "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>",
                  "type": "module",
                  "displayName": "Source map cache"
                }
              ],
              "type": "module",
              "displayName": "`NODE_V8_COVERAGE=dir`"
            },
            {
              "textRaw": "`OPENSSL_CONF=file`",
              "name": "`openssl_conf=file`",
              "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 <code>./configure --openssl-fips</code>.</p>\n<p>If the <a href=\"cli.html#cli_openssl_config_file\"><code>--openssl-config</code></a> command line option is used, the environment\nvariable is ignored.</p>",
              "type": "module",
              "displayName": "`OPENSSL_CONF=file`"
            },
            {
              "textRaw": "`SSL_CERT_DIR=dir`",
              "name": "`ssl_cert_dir=dir`",
              "meta": {
                "added": [
                  "v7.7.0"
                ],
                "changes": []
              },
              "desc": "<p>If <code>--use-openssl-ca</code> is enabled, 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>",
              "type": "module",
              "displayName": "`SSL_CERT_DIR=dir`"
            },
            {
              "textRaw": "`SSL_CERT_FILE=file`",
              "name": "`ssl_cert_file=file`",
              "meta": {
                "added": [
                  "v7.7.0"
                ],
                "changes": []
              },
              "desc": "<p>If <code>--use-openssl-ca</code> is enabled, 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>",
              "type": "module",
              "displayName": "`SSL_CERT_FILE=file`"
            },
            {
              "textRaw": "`UV_THREADPOOL_SIZE=size`",
              "name": "`uv_threadpool_size=size`",
              "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). For more information, see the\n<a href=\"http://docs.libuv.org/en/latest/threadpool.html\">libuv threadpool documentation</a>.</p>",
              "type": "module",
              "displayName": "`UV_THREADPOOL_SIZE=size`"
            }
          ],
          "type": "misc",
          "displayName": "Environment variables"
        },
        {
          "textRaw": "Useful V8 options",
          "name": "useful_v8_options",
          "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": "`--max-old-space-size=SIZE` (in megabytes)",
              "name": "`--max-old-space-size=size`_(in_megabytes)",
              "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 2GB of memory, consider setting this to\n1536 (1.5GB) to leave some memory for other uses and avoid swapping.</p>\n<pre><code class=\"language-console\">$ node --max-old-space-size=1536 index.js\n</code></pre>",
              "type": "module",
              "displayName": "`--max-old-space-size=SIZE` (in megabytes)"
            }
          ],
          "type": "misc",
          "displayName": "Useful V8 options"
        }
      ]
    },
    {
      "textRaw": "Debugger",
      "name": "Debugger",
      "introduced_in": "v0.9.12",
      "stability": 2,
      "stabilityText": "Stable",
      "type": "misc",
      "desc": "<p>Node.js includes an out-of-process debugging utility accessible via a\n<a href=\"debugger.html#debugger_v8_inspector_integration_for_node_js\">V8 Inspector</a> and built-in debugging client. To use it, start Node.js\nwith the <code>inspect</code> argument followed by the path to the script to debug; a\nprompt will be displayed indicating successful launch of the debugger:</p>\n<pre><code class=\"language-console\">$ node inspect myscript.js\n&#x3C; Debugger listening on ws://127.0.0.1:9229/80e7a814-7cd3-49fb-921a-2e02228cd5ba\n&#x3C; For help, see: https://nodejs.org/en/docs/inspector\n&#x3C; Debugger attached.\nBreak on start in myscript.js:1\n> 1 (function (exports, require, module, __filename, __dirname) { global.x = 5;\n  2 setTimeout(() => {\n  3   console.log('world');\ndebug>\n</code></pre>\n<p>The Node.js debugger client is not a full-featured debugger, but simple step and\ninspection are possible.</p>\n<p>Inserting the statement <code>debugger;</code> into the source code of a script will\nenable a breakpoint at that position in the code:</p>\n<!-- eslint-disable no-debugger -->\n<pre><code class=\"language-js\">// myscript.js\nglobal.x = 5;\nsetTimeout(() => {\n  debugger;\n  console.log('world');\n}, 1000);\nconsole.log('hello');\n</code></pre>\n<p>Once the debugger is run, a breakpoint will occur at line 3:</p>\n<pre><code class=\"language-console\">$ node inspect myscript.js\n&#x3C; Debugger listening on ws://127.0.0.1:9229/80e7a814-7cd3-49fb-921a-2e02228cd5ba\n&#x3C; For help, see: https://nodejs.org/en/docs/inspector\n&#x3C; Debugger attached.\nBreak on start in myscript.js:1\n> 1 (function (exports, require, module, __filename, __dirname) { global.x = 5;\n  2 setTimeout(() => {\n  3   debugger;\ndebug> cont\n&#x3C; hello\nbreak in myscript.js:3\n  1 (function (exports, require, module, __filename, __dirname) { global.x = 5;\n  2 setTimeout(() => {\n> 3   debugger;\n  4   console.log('world');\n  5 }, 1000);\ndebug> next\nbreak in myscript.js:4\n  2 setTimeout(() => {\n  3   debugger;\n> 4   console.log('world');\n  5 }, 1000);\n  6 console.log('hello');\ndebug> repl\nPress Ctrl + C to leave debug repl\n> x\n5\n> 2 + 2\n4\ndebug> next\n&#x3C; world\nbreak in myscript.js:5\n  3   debugger;\n  4   console.log('world');\n> 5 }, 1000);\n  6 console.log('hello');\n  7\ndebug> .exit\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>",
      "miscs": [
        {
          "textRaw": "Watchers",
          "name": "watchers",
          "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>",
          "type": "misc",
          "displayName": "Watchers"
        },
        {
          "textRaw": "Command reference",
          "name": "command_reference",
          "modules": [
            {
              "textRaw": "Stepping",
              "name": "stepping",
              "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>",
              "type": "module",
              "displayName": "Stepping"
            },
            {
              "textRaw": "Breakpoints",
              "name": "breakpoints",
              "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\nfunctions 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>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/4e3db158-9791-4274-8909-914f7facf3bd\n&#x3C; For help, see: https://nodejs.org/en/docs/inspector\n&#x3C; Debugger attached.\nBreak on start in main.js:1\n> 1 (function (exports, require, module, __filename, __dirname) { 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>",
              "type": "module",
              "displayName": "Breakpoints"
            },
            {
              "textRaw": "Information",
              "name": "information",
              "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>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>: Execute an expression in debugging script's context</li>\n</ul>",
              "type": "module",
              "displayName": "Information"
            },
            {
              "textRaw": "Execution control",
              "name": "execution_control",
              "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>",
              "type": "module",
              "displayName": "Execution control"
            },
            {
              "textRaw": "Various",
              "name": "various",
              "desc": "<ul>\n<li><code>scripts</code>: List all loaded scripts</li>\n<li><code>version</code>: Display V8's version</li>\n</ul>",
              "type": "module",
              "displayName": "Various"
            }
          ],
          "type": "misc",
          "displayName": "Command reference"
        },
        {
          "textRaw": "Advanced usage",
          "name": "advanced_usage",
          "modules": [
            {
              "textRaw": "V8 inspector integration for Node.js",
              "name": "v8_inspector_integration_for_node.js",
              "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>To break on the first line of the application code, pass the <code>--inspect-brk</code>\nflag instead of <code>--inspect</code>.</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/en/docs/inspector\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>\n<p>If the Chrome browser is older than 66.0.3345.0,\nuse <code>inspector.html</code> instead of <code>js_app.html</code> in the above URL.</p>\n<p>Chrome DevTools doesn't support debugging <a href=\"worker_threads.html\">worker threads</a> yet.\n<a href=\"https://github.com/GoogleChromeLabs/ndb/\">ndb</a> can be used to debug them.</p>",
              "type": "module",
              "displayName": "V8 inspector integration for Node.js"
            }
          ],
          "type": "misc",
          "displayName": "Advanced usage"
        }
      ]
    },
    {
      "textRaw": "Deprecated APIs",
      "name": "Deprecated APIs",
      "introduced_in": "v7.7.0",
      "type": "misc",
      "desc": "<p>Node.js may deprecate APIs 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 utilizes three kinds of Deprecations:</p>\n<ul>\n<li>Documentation-only</li>\n<li>Runtime</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#cli_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=\"deprecations.html#deprecations_list_of_deprecated_apis\">list of Deprecated APIs</a>.</p>\n<p>A Runtime deprecation will, by default, generate a process warning that will\nbe printed to <code>stderr</code> the first time the deprecated API is used. When the\n<a href=\"cli.html#cli_throw_deprecation\"><code>--throw-deprecation</code></a> command-line flag is used, a Runtime deprecation will\ncause an error to be thrown.</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",
          "desc": "<p>Occasionally, the deprecation of an API may 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>",
          "type": "misc",
          "displayName": "Revoking deprecations"
        },
        {
          "textRaw": "List of deprecated APIs",
          "name": "list_of_deprecated_apis",
          "desc": "<p><a id=\"DEP0001\"></a></p>",
          "modules": [
            {
              "textRaw": "DEP0001: `http.OutgoingMessage.prototype.flush`",
              "name": "dep0001:_`http.outgoingmessage.prototype.flush`",
              "meta": {
                "changes": [
                  {
                    "version": [
                      "v4.8.6",
                      "v6.12.0"
                    ],
                    "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: Runtime</p>\n<p>The <code>OutgoingMessage.prototype.flush()</code> method is deprecated. Use\n<code>OutgoingMessage.prototype.flushHeaders()</code> instead.</p>\n<p><a id=\"DEP0002\"></a></p>",
              "type": "module",
              "displayName": "DEP0001: `http.OutgoingMessage.prototype.flush`"
            },
            {
              "textRaw": "DEP0002: `require('_linklist')`",
              "name": "dep0002:_`require('_linklist')`",
              "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>\n<p><a id=\"DEP0003\"></a></p>",
              "type": "module",
              "displayName": "DEP0002: `require('_linklist')`"
            },
            {
              "textRaw": "DEP0003: `_writableState.buffer`",
              "name": "dep0003:_`_writablestate.buffer`",
              "meta": {
                "changes": [
                  {
                    "version": [
                      "v4.8.6",
                      "v6.12.0"
                    ],
                    "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: Runtime</p>\n<p>The <code>_writableState.buffer</code> property is deprecated. Use the\n<code>_writableState.getBuffer()</code> method instead.</p>\n<p><a id=\"DEP0004\"></a></p>",
              "type": "module",
              "displayName": "DEP0003: `_writableState.buffer`"
            },
            {
              "textRaw": "DEP0004: `CryptoStream.prototype.readyState`",
              "name": "dep0004:_`cryptostream.prototype.readystate`",
              "meta": {
                "changes": [
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/17882",
                    "description": "End-of-Life."
                  },
                  {
                    "version": [
                      "v4.8.6",
                      "v6.12.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/10116",
                    "description": "A deprecation code has been assigned."
                  },
                  {
                    "version": "0.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>\n<p><a id=\"DEP0005\"></a></p>",
              "type": "module",
              "displayName": "DEP0004: `CryptoStream.prototype.readyState`"
            },
            {
              "textRaw": "DEP0005: `Buffer()` constructor",
              "name": "dep0005:_`buffer()`_constructor",
              "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: Runtime (supports <a href=\"cli.html#cli_pending_deprecation\"><code>--pending-deprecation</code></a>)</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#buffer_class_method_buffer_alloc_size_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#buffer_class_method_buffer_allocunsafe_size\"><code>Buffer.allocUnsafe(size)</code></a>: Create a <code>Buffer</code> with\n<em>uninitialized</em> memory.</li>\n<li><a href=\"buffer.html#buffer_class_method_buffer_allocunsafeslow_size\"><code>Buffer.allocUnsafeSlow(size)</code></a>: Create a <code>Buffer</code> with <em>uninitialized</em>\nmemory.</li>\n<li><a href=\"buffer.html#buffer_class_method_buffer_from_array\"><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#buffer_class_method_buffer_from_arraybuffer_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#buffer_class_method_buffer_from_buffer\"><code>Buffer.from(buffer)</code></a>: Create a <code>Buffer</code> that copies <code>buffer</code>.</li>\n<li><a href=\"buffer.html#buffer_class_method_buffer_from_string_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>\n<p><a id=\"DEP0006\"></a></p>",
              "type": "module",
              "displayName": "DEP0005: `Buffer()` constructor"
            },
            {
              "textRaw": "DEP0006: `child_process` `options.customFds`",
              "name": "dep0006:_`child_process`_`options.customfds`",
              "meta": {
                "changes": [
                  {
                    "version": "v12.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/25279",
                    "description": "End-of-Life."
                  },
                  {
                    "version": [
                      "v4.8.6",
                      "v6.12.0"
                    ],
                    "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.11",
                    "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>\n<p><a id=\"DEP0007\"></a></p>",
              "type": "module",
              "displayName": "DEP0006: `child_process` `options.customFds`"
            },
            {
              "textRaw": "DEP0007: Replace `cluster` `worker.suicide` with `worker.exitedAfterDisconnect`",
              "name": "dep0007:_replace_`cluster`_`worker.suicide`_with_`worker.exitedafterdisconnect`",
              "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#cluster_worker_exitedafterdisconnect\"><code>worker.exitedAfterDisconnect</code></a> property. The old property name did not\nprecisely describe the actual semantics and was unnecessarily emotion-laden.</p>\n<p><a id=\"DEP0008\"></a></p>",
              "type": "module",
              "displayName": "DEP0007: Replace `cluster` `worker.suicide` with `worker.exitedAfterDisconnect`"
            },
            {
              "textRaw": "DEP0008: `require('constants')`",
              "name": "dep0008:_`require('constants')`",
              "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>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('fs').constants</code> and <code>require('os').constants</code>.</p>\n<p><a id=\"DEP0009\"></a></p>",
              "type": "module",
              "displayName": "DEP0008: `require('constants')`"
            },
            {
              "textRaw": "DEP0009: `crypto.pbkdf2` without digest",
              "name": "dep0009:_`crypto.pbkdf2`_without_digest",
              "meta": {
                "changes": [
                  {
                    "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: Runtime</p>\n<p>Use of the <a href=\"crypto.html#crypto_crypto_pbkdf2_password_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 v11.0.0, calling these functions with <code>digest</code> set to\n<code>null</code> will print a deprecation warning to align with the behavior when <code>digest</code>\nis <code>undefined</code>.</p>\n<p><a id=\"DEP0010\"></a></p>",
              "type": "module",
              "displayName": "DEP0009: `crypto.pbkdf2` without digest"
            },
            {
              "textRaw": "DEP0010: `crypto.createCredentials`",
              "name": "dep0010:_`crypto.createcredentials`",
              "meta": {
                "changes": [
                  {
                    "version": "v11.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/21153",
                    "description": "End-of-Life."
                  },
                  {
                    "version": [
                      "v4.8.6",
                      "v6.12.0"
                    ],
                    "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#tls_tls_createsecurecontext_options\"><code>tls.createSecureContext()</code></a> instead.</p>\n<p><a id=\"DEP0011\"></a></p>",
              "type": "module",
              "displayName": "DEP0010: `crypto.createCredentials`"
            },
            {
              "textRaw": "DEP0011: `crypto.Credentials`",
              "name": "dep0011:_`crypto.credentials`",
              "meta": {
                "changes": [
                  {
                    "version": "v11.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/21153",
                    "description": "End-of-Life."
                  },
                  {
                    "version": [
                      "v4.8.6",
                      "v6.12.0"
                    ],
                    "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#tls_tls_createsecurecontext_options\"><code>tls.SecureContext</code></a>\ninstead.</p>\n<p><a id=\"DEP0012\"></a></p>",
              "type": "module",
              "displayName": "DEP0011: `crypto.Credentials`"
            },
            {
              "textRaw": "DEP0012: `Domain.dispose`",
              "name": "dep0012:_`domain.dispose`",
              "meta": {
                "changes": [
                  {
                    "version": "v9.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/15412",
                    "description": "End-of-Life."
                  },
                  {
                    "version": [
                      "v4.8.6",
                      "v6.12.0"
                    ],
                    "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>\n<p><a id=\"DEP0013\"></a></p>",
              "type": "module",
              "displayName": "DEP0012: `Domain.dispose`"
            },
            {
              "textRaw": "DEP0013: `fs` asynchronous function without callback",
              "name": "dep0013:_`fs`_asynchronous_function_without_callback",
              "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>\n<p><a id=\"DEP0014\"></a></p>",
              "type": "module",
              "displayName": "DEP0013: `fs` asynchronous function without callback"
            },
            {
              "textRaw": "DEP0014: `fs.read` legacy String interface",
              "name": "dep0014:_`fs.read`_legacy_string_interface",
              "meta": {
                "changes": [
                  {
                    "version": "v8.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/9683",
                    "description": "End-of-Life."
                  },
                  {
                    "version": "v6.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/4525",
                    "description": "Runtime deprecation."
                  },
                  {
                    "version": [
                      "v4.8.6",
                      "v6.12.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/10116",
                    "description": "A deprecation code has been assigned."
                  },
                  {
                    "version": "v0.1.96",
                    "commit": "c93e0aaf062081db3ec40ac45b3e2c979d5759d6",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>The <a href=\"fs.html#fs_fs_read_fd_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>\n<p><a id=\"DEP0015\"></a></p>",
              "type": "module",
              "displayName": "DEP0014: `fs.read` legacy String interface"
            },
            {
              "textRaw": "DEP0015: `fs.readSync` legacy String interface",
              "name": "dep0015:_`fs.readsync`_legacy_string_interface",
              "meta": {
                "changes": [
                  {
                    "version": "v8.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/9683",
                    "description": "End-of-Life."
                  },
                  {
                    "version": "v6.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/4525",
                    "description": "Runtime deprecation."
                  },
                  {
                    "version": [
                      "v4.8.6",
                      "v6.12.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/10116",
                    "description": "A deprecation code has been assigned."
                  },
                  {
                    "version": "v0.1.96",
                    "commit": "c93e0aaf062081db3ec40ac45b3e2c979d5759d6",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>The <a href=\"fs.html#fs_fs_readsync_fd_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>\n<p><a id=\"DEP0016\"></a></p>",
              "type": "module",
              "displayName": "DEP0015: `fs.readSync` legacy String interface"
            },
            {
              "textRaw": "DEP0016: `GLOBAL`/`root`",
              "name": "dep0016:_`global`/`root`",
              "meta": {
                "changes": [
                  {
                    "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: Runtime</p>\n<p>The <code>GLOBAL</code> and <code>root</code> aliases for the <code>global</code> property are deprecated\nand should no longer be used.</p>\n<p><a id=\"DEP0017\"></a></p>",
              "type": "module",
              "displayName": "DEP0016: `GLOBAL`/`root`"
            },
            {
              "textRaw": "DEP0017: `Intl.v8BreakIterator`",
              "name": "dep0017:_`intl.v8breakiterator`",
              "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>\n<p><a id=\"DEP0018\"></a></p>",
              "type": "module",
              "displayName": "DEP0017: `Intl.v8BreakIterator`"
            },
            {
              "textRaw": "DEP0018: Unhandled promise rejections",
              "name": "dep0018:_unhandled_promise_rejections",
              "meta": {
                "changes": [
                  {
                    "version": "v7.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/8217",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Runtime</p>\n<p>Unhandled promise rejections are deprecated. In the future, promise rejections\nthat are not handled will terminate the Node.js process with a non-zero exit\ncode.</p>\n<p><a id=\"DEP0019\"></a></p>",
              "type": "module",
              "displayName": "DEP0018: Unhandled promise rejections"
            },
            {
              "textRaw": "DEP0019: `require('.')` resolved outside directory",
              "name": "dep0019:_`require('.')`_resolved_outside_directory",
              "meta": {
                "changes": [
                  {
                    "version": "v12.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/26973",
                    "description": "Removed functionality."
                  },
                  {
                    "version": [
                      "v4.8.6",
                      "v6.12.0"
                    ],
                    "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>\n<p><a id=\"DEP0020\"></a></p>",
              "type": "module",
              "displayName": "DEP0019: `require('.')` resolved outside directory"
            },
            {
              "textRaw": "DEP0020: `Server.connections`",
              "name": "dep0020:_`server.connections`",
              "meta": {
                "changes": [
                  {
                    "version": [
                      "v4.8.6",
                      "v6.12.0"
                    ],
                    "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: Runtime</p>\n<p>The <a href=\"net.html#net_server_connections\"><code>Server.connections</code></a> property is deprecated. Please use the\n<a href=\"net.html#net_server_getconnections_callback\"><code>Server.getConnections()</code></a> method instead.</p>\n<p><a id=\"DEP0021\"></a></p>",
              "type": "module",
              "displayName": "DEP0020: `Server.connections`"
            },
            {
              "textRaw": "DEP0021: `Server.listenFD`",
              "name": "dep0021:_`server.listenfd`",
              "meta": {
                "changes": [
                  {
                    "version": "v12.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/27127",
                    "description": "End-of-Life."
                  },
                  {
                    "version": [
                      "v4.8.6",
                      "v6.12.0"
                    ],
                    "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#net_server_listen_handle_backlog_callback\"><code>Server.listen({fd: &#x3C;number>})</code></a> instead.</p>\n<p><a id=\"DEP0022\"></a></p>",
              "type": "module",
              "displayName": "DEP0021: `Server.listenFD`"
            },
            {
              "textRaw": "DEP0022: `os.tmpDir()`",
              "name": "dep0022:_`os.tmpdir()`",
              "meta": {
                "changes": [
                  {
                    "version": "v7.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/6739",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Runtime</p>\n<p>The <code>os.tmpDir()</code> API is deprecated. Please use <a href=\"os.html#os_os_tmpdir\"><code>os.tmpdir()</code></a> instead.</p>\n<p><a id=\"DEP0023\"></a></p>",
              "type": "module",
              "displayName": "DEP0022: `os.tmpDir()`"
            },
            {
              "textRaw": "DEP0023: `os.getNetworkInterfaces()`",
              "name": "dep0023:_`os.getnetworkinterfaces()`",
              "meta": {
                "changes": [
                  {
                    "version": "v12.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/25280",
                    "description": "End-of-Life."
                  },
                  {
                    "version": [
                      "v4.8.6",
                      "v6.12.0"
                    ],
                    "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#os_os_networkinterfaces\"><code>os.networkInterfaces()</code></a> method instead.</p>\n<p><a id=\"DEP0024\"></a></p>",
              "type": "module",
              "displayName": "DEP0023: `os.getNetworkInterfaces()`"
            },
            {
              "textRaw": "DEP0024: `REPLServer.prototype.convertToContext()`",
              "name": "dep0024:_`replserver.prototype.converttocontext()`",
              "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>\n<p><a id=\"DEP0025\"></a></p>",
              "type": "module",
              "displayName": "DEP0024: `REPLServer.prototype.convertToContext()`"
            },
            {
              "textRaw": "DEP0025: `require('sys')`",
              "name": "dep0025:_`require('sys')`",
              "meta": {
                "changes": [
                  {
                    "version": [
                      "v4.8.6",
                      "v6.12.0"
                    ],
                    "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>sys</code> module is deprecated. Please use the <a href=\"util.html\"><code>util</code></a> module instead.</p>\n<p><a id=\"DEP0026\"></a></p>",
              "type": "module",
              "displayName": "DEP0025: `require('sys')`"
            },
            {
              "textRaw": "DEP0026: `util.print()`",
              "name": "dep0026:_`util.print()`",
              "meta": {
                "changes": [
                  {
                    "version": "v12.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/25377",
                    "description": "End-of-Life."
                  },
                  {
                    "version": [
                      "v4.8.6",
                      "v6.12.0"
                    ],
                    "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#console_console_log_data_args\"><code>console.log()</code></a> instead.</p>\n<p><a id=\"DEP0027\"></a></p>",
              "type": "module",
              "displayName": "DEP0026: `util.print()`"
            },
            {
              "textRaw": "DEP0027: `util.puts()`",
              "name": "dep0027:_`util.puts()`",
              "meta": {
                "changes": [
                  {
                    "version": "v12.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/25377",
                    "description": "End-of-Life."
                  },
                  {
                    "version": [
                      "v4.8.6",
                      "v6.12.0"
                    ],
                    "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#console_console_log_data_args\"><code>console.log()</code></a> instead.</p>\n<p><a id=\"DEP0028\"></a></p>",
              "type": "module",
              "displayName": "DEP0027: `util.puts()`"
            },
            {
              "textRaw": "DEP0028: `util.debug()`",
              "name": "dep0028:_`util.debug()`",
              "meta": {
                "changes": [
                  {
                    "version": "v12.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/25377",
                    "description": "End-of-Life."
                  },
                  {
                    "version": [
                      "v4.8.6",
                      "v6.12.0"
                    ],
                    "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#console_console_error_data_args\"><code>console.error()</code></a> instead.</p>\n<p><a id=\"DEP0029\"></a></p>",
              "type": "module",
              "displayName": "DEP0028: `util.debug()`"
            },
            {
              "textRaw": "DEP0029: `util.error()`",
              "name": "dep0029:_`util.error()`",
              "meta": {
                "changes": [
                  {
                    "version": "v12.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/25377",
                    "description": "End-of-Life."
                  },
                  {
                    "version": [
                      "v4.8.6",
                      "v6.12.0"
                    ],
                    "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#console_console_error_data_args\"><code>console.error()</code></a> instead.</p>\n<p><a id=\"DEP0030\"></a></p>",
              "type": "module",
              "displayName": "DEP0029: `util.error()`"
            },
            {
              "textRaw": "DEP0030: `SlowBuffer`",
              "name": "dep0030:_`slowbuffer`",
              "meta": {
                "changes": [
                  {
                    "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: Documentation-only</p>\n<p>The <a href=\"buffer.html#buffer_class_slowbuffer\"><code>SlowBuffer</code></a> class is deprecated. Please use\n<a href=\"buffer.html#buffer_class_method_buffer_allocunsafeslow_size\"><code>Buffer.allocUnsafeSlow(size)</code></a> instead.</p>\n<p><a id=\"DEP0031\"></a></p>",
              "type": "module",
              "displayName": "DEP0030: `SlowBuffer`"
            },
            {
              "textRaw": "DEP0031: `ecdh.setPublicKey()`",
              "name": "dep0031:_`ecdh.setpublickey()`",
              "meta": {
                "changes": [
                  {
                    "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: Documentation-only</p>\n<p>The <a href=\"crypto.html#crypto_ecdh_setpublickey_publickey_encoding\"><code>ecdh.setPublicKey()</code></a> method is now deprecated as its inclusion in the\nAPI is not useful.</p>\n<p><a id=\"DEP0032\"></a></p>",
              "type": "module",
              "displayName": "DEP0031: `ecdh.setPublicKey()`"
            },
            {
              "textRaw": "DEP0032: `domain` module",
              "name": "dep0032:_`domain`_module",
              "meta": {
                "changes": [
                  {
                    "version": [
                      "v4.8.6",
                      "v6.12.0"
                    ],
                    "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>\n<p><a id=\"DEP0033\"></a></p>",
              "type": "module",
              "displayName": "DEP0032: `domain` module"
            },
            {
              "textRaw": "DEP0033: `EventEmitter.listenerCount()`",
              "name": "dep0033:_`eventemitter.listenercount()`",
              "meta": {
                "changes": [
                  {
                    "version": [
                      "v4.8.6",
                      "v6.12.0"
                    ],
                    "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: Documentation-only</p>\n<p>The <a href=\"events.html#events_eventemitter_listenercount_emitter_eventname\"><code>EventEmitter.listenerCount(emitter, eventName)</code></a> API is\ndeprecated. Please use <a href=\"events.html#events_emitter_listenercount_eventname\"><code>emitter.listenerCount(eventName)</code></a> instead.</p>\n<p><a id=\"DEP0034\"></a></p>",
              "type": "module",
              "displayName": "DEP0033: `EventEmitter.listenerCount()`"
            },
            {
              "textRaw": "DEP0034: `fs.exists(path, callback)`",
              "name": "dep0034:_`fs.exists(path,_callback)`",
              "meta": {
                "changes": [
                  {
                    "version": [
                      "v4.8.6",
                      "v6.12.0"
                    ],
                    "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/iojs/io.js/pull/166",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Documentation-only</p>\n<p>The <a href=\"fs.html#fs_fs_exists_path_callback\"><code>fs.exists(path, callback)</code></a> API is deprecated. Please use\n<a href=\"fs.html#fs_fs_stat_path_options_callback\"><code>fs.stat()</code></a> or <a href=\"fs.html#fs_fs_access_path_mode_callback\"><code>fs.access()</code></a> instead.</p>\n<p><a id=\"DEP0035\"></a></p>",
              "type": "module",
              "displayName": "DEP0034: `fs.exists(path, callback)`"
            },
            {
              "textRaw": "DEP0035: `fs.lchmod(path, mode, callback)`",
              "name": "dep0035:_`fs.lchmod(path,_mode,_callback)`",
              "meta": {
                "changes": [
                  {
                    "version": [
                      "v4.8.6",
                      "v6.12.0"
                    ],
                    "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#fs_fs_lchmod_path_mode_callback\"><code>fs.lchmod(path, mode, callback)</code></a> API is deprecated.</p>\n<p><a id=\"DEP0036\"></a></p>",
              "type": "module",
              "displayName": "DEP0035: `fs.lchmod(path, mode, callback)`"
            },
            {
              "textRaw": "DEP0036: `fs.lchmodSync(path, mode)`",
              "name": "dep0036:_`fs.lchmodsync(path,_mode)`",
              "meta": {
                "changes": [
                  {
                    "version": [
                      "v4.8.6",
                      "v6.12.0"
                    ],
                    "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#fs_fs_lchmodsync_path_mode\"><code>fs.lchmodSync(path, mode)</code></a> API is deprecated.</p>\n<p><a id=\"DEP0037\"></a></p>",
              "type": "module",
              "displayName": "DEP0036: `fs.lchmodSync(path, mode)`"
            },
            {
              "textRaw": "DEP0037: `fs.lchown(path, uid, gid, callback)`",
              "name": "dep0037:_`fs.lchown(path,_uid,_gid,_callback)`",
              "meta": {
                "changes": [
                  {
                    "version": "v10.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/21498",
                    "description": "Deprecation revoked."
                  },
                  {
                    "version": [
                      "v4.8.6",
                      "v6.12.0"
                    ],
                    "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#fs_fs_lchown_path_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>\n<p><a id=\"DEP0038\"></a></p>",
              "type": "module",
              "displayName": "DEP0037: `fs.lchown(path, uid, gid, callback)`"
            },
            {
              "textRaw": "DEP0038: `fs.lchownSync(path, uid, gid)`",
              "name": "dep0038:_`fs.lchownsync(path,_uid,_gid)`",
              "meta": {
                "changes": [
                  {
                    "version": "v10.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/21498",
                    "description": "Deprecation revoked."
                  },
                  {
                    "version": [
                      "v4.8.6",
                      "v6.12.0"
                    ],
                    "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#fs_fs_lchownsync_path_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>\n<p><a id=\"DEP0039\"></a></p>",
              "type": "module",
              "displayName": "DEP0038: `fs.lchownSync(path, uid, gid)`"
            },
            {
              "textRaw": "DEP0039: `require.extensions`",
              "name": "dep0039:_`require.extensions`",
              "meta": {
                "changes": [
                  {
                    "version": [
                      "v4.8.6",
                      "v6.12.0"
                    ],
                    "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#modules_require_extensions\"><code>require.extensions</code></a> property is deprecated.</p>\n<p><a id=\"DEP0040\"></a></p>",
              "type": "module",
              "displayName": "DEP0039: `require.extensions`"
            },
            {
              "textRaw": "DEP0040: `punycode` module",
              "name": "dep0040:_`punycode`_module",
              "meta": {
                "changes": [
                  {
                    "version": "v7.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/7941",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Documentation-only</p>\n<p>The <a href=\"punycode.html\"><code>punycode</code></a> module is deprecated. Please use a userland alternative\ninstead.</p>\n<p><a id=\"DEP0041\"></a></p>",
              "type": "module",
              "displayName": "DEP0040: `punycode` module"
            },
            {
              "textRaw": "DEP0041: `NODE_REPL_HISTORY_FILE` environment variable",
              "name": "dep0041:_`node_repl_history_file`_environment_variable",
              "meta": {
                "changes": [
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/13876",
                    "description": "End-of-Life."
                  },
                  {
                    "version": [
                      "v4.8.6",
                      "v6.12.0"
                    ],
                    "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>\n<p><a id=\"DEP0042\"></a></p>",
              "type": "module",
              "displayName": "DEP0041: `NODE_REPL_HISTORY_FILE` environment variable"
            },
            {
              "textRaw": "DEP0042: `tls.CryptoStream`",
              "name": "dep0042:_`tls.cryptostream`",
              "meta": {
                "changes": [
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/17882",
                    "description": "End-of-Life."
                  },
                  {
                    "version": [
                      "v4.8.6",
                      "v6.12.0"
                    ],
                    "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 <a href=\"tls.html#tls_class_cryptostream\"><code>tls.CryptoStream</code></a> class was removed. Please use\n<a href=\"tls.html#tls_class_tls_tlssocket\"><code>tls.TLSSocket</code></a> instead.</p>\n<p><a id=\"DEP0043\"></a></p>",
              "type": "module",
              "displayName": "DEP0042: `tls.CryptoStream`"
            },
            {
              "textRaw": "DEP0043: `tls.SecurePair`",
              "name": "dep0043:_`tls.securepair`",
              "meta": {
                "changes": [
                  {
                    "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: Documentation-only</p>\n<p>The <a href=\"tls.html#tls_class_securepair\"><code>tls.SecurePair</code></a> class is deprecated. Please use\n<a href=\"tls.html#tls_class_tls_tlssocket\"><code>tls.TLSSocket</code></a> instead.</p>\n<p><a id=\"DEP0044\"></a></p>",
              "type": "module",
              "displayName": "DEP0043: `tls.SecurePair`"
            },
            {
              "textRaw": "DEP0044: `util.isArray()`",
              "name": "dep0044:_`util.isarray()`",
              "meta": {
                "changes": [
                  {
                    "version": [
                      "v4.8.6",
                      "v6.12.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/10116",
                    "description": "A deprecation code has been assigned."
                  },
                  {
                    "version": [
                      "v3.3.1",
                      "v4.0.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/2447",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Documentation-only</p>\n<p>The <a href=\"util.html#util_util_isarray_object\"><code>util.isArray()</code></a> API is deprecated. Please use <code>Array.isArray()</code>\ninstead.</p>\n<p><a id=\"DEP0045\"></a></p>",
              "type": "module",
              "displayName": "DEP0044: `util.isArray()`"
            },
            {
              "textRaw": "DEP0045: `util.isBoolean()`",
              "name": "dep0045:_`util.isboolean()`",
              "meta": {
                "changes": [
                  {
                    "version": [
                      "v4.8.6",
                      "v6.12.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/10116",
                    "description": "A deprecation code has been assigned."
                  },
                  {
                    "version": [
                      "v3.3.1",
                      "v4.0.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/2447",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Documentation-only</p>\n<p>The <a href=\"util.html#util_util_isboolean_object\"><code>util.isBoolean()</code></a> API is deprecated.</p>\n<p><a id=\"DEP0046\"></a></p>",
              "type": "module",
              "displayName": "DEP0045: `util.isBoolean()`"
            },
            {
              "textRaw": "DEP0046: `util.isBuffer()`",
              "name": "dep0046:_`util.isbuffer()`",
              "meta": {
                "changes": [
                  {
                    "version": [
                      "v4.8.6",
                      "v6.12.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/10116",
                    "description": "A deprecation code has been assigned."
                  },
                  {
                    "version": [
                      "v3.3.1",
                      "v4.0.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/2447",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Documentation-only</p>\n<p>The <a href=\"util.html#util_util_isbuffer_object\"><code>util.isBuffer()</code></a> API is deprecated. Please use\n<a href=\"buffer.html#buffer_class_method_buffer_isbuffer_obj\"><code>Buffer.isBuffer()</code></a> instead.</p>\n<p><a id=\"DEP0047\"></a></p>",
              "type": "module",
              "displayName": "DEP0046: `util.isBuffer()`"
            },
            {
              "textRaw": "DEP0047: `util.isDate()`",
              "name": "dep0047:_`util.isdate()`",
              "meta": {
                "changes": [
                  {
                    "version": [
                      "v4.8.6",
                      "v6.12.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/10116",
                    "description": "A deprecation code has been assigned."
                  },
                  {
                    "version": [
                      "v3.3.1",
                      "v4.0.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/2447",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Documentation-only</p>\n<p>The <a href=\"util.html#util_util_isdate_object\"><code>util.isDate()</code></a> API is deprecated.</p>\n<p><a id=\"DEP0048\"></a></p>",
              "type": "module",
              "displayName": "DEP0047: `util.isDate()`"
            },
            {
              "textRaw": "DEP0048: `util.isError()`",
              "name": "dep0048:_`util.iserror()`",
              "meta": {
                "changes": [
                  {
                    "version": [
                      "v4.8.6",
                      "v6.12.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/10116",
                    "description": "A deprecation code has been assigned."
                  },
                  {
                    "version": [
                      "v3.3.1",
                      "v4.0.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/2447",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Documentation-only</p>\n<p>The <a href=\"util.html#util_util_iserror_object\"><code>util.isError()</code></a> API is deprecated.</p>\n<p><a id=\"DEP0049\"></a></p>",
              "type": "module",
              "displayName": "DEP0048: `util.isError()`"
            },
            {
              "textRaw": "DEP0049: `util.isFunction()`",
              "name": "dep0049:_`util.isfunction()`",
              "meta": {
                "changes": [
                  {
                    "version": [
                      "v4.8.6",
                      "v6.12.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/10116",
                    "description": "A deprecation code has been assigned."
                  },
                  {
                    "version": [
                      "v3.3.1",
                      "v4.0.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/2447",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Documentation-only</p>\n<p>The <a href=\"util.html#util_util_isfunction_object\"><code>util.isFunction()</code></a> API is deprecated.</p>\n<p><a id=\"DEP0050\"></a></p>",
              "type": "module",
              "displayName": "DEP0049: `util.isFunction()`"
            },
            {
              "textRaw": "DEP0050: `util.isNull()`",
              "name": "dep0050:_`util.isnull()`",
              "meta": {
                "changes": [
                  {
                    "version": [
                      "v4.8.6",
                      "v6.12.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/10116",
                    "description": "A deprecation code has been assigned."
                  },
                  {
                    "version": [
                      "v3.3.1",
                      "v4.0.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/2447",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Documentation-only</p>\n<p>The <a href=\"util.html#util_util_isnull_object\"><code>util.isNull()</code></a> API is deprecated.</p>\n<p><a id=\"DEP0051\"></a></p>",
              "type": "module",
              "displayName": "DEP0050: `util.isNull()`"
            },
            {
              "textRaw": "DEP0051: `util.isNullOrUndefined()`",
              "name": "dep0051:_`util.isnullorundefined()`",
              "meta": {
                "changes": [
                  {
                    "version": [
                      "v4.8.6",
                      "v6.12.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/10116",
                    "description": "A deprecation code has been assigned."
                  },
                  {
                    "version": [
                      "v3.3.1",
                      "v4.0.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/2447",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Documentation-only</p>\n<p>The <a href=\"util.html#util_util_isnullorundefined_object\"><code>util.isNullOrUndefined()</code></a> API is deprecated.</p>\n<p><a id=\"DEP0052\"></a></p>",
              "type": "module",
              "displayName": "DEP0051: `util.isNullOrUndefined()`"
            },
            {
              "textRaw": "DEP0052: `util.isNumber()`",
              "name": "dep0052:_`util.isnumber()`",
              "meta": {
                "changes": [
                  {
                    "version": [
                      "v4.8.6",
                      "v6.12.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/10116",
                    "description": "A deprecation code has been assigned."
                  },
                  {
                    "version": [
                      "v3.3.1",
                      "v4.0.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/2447",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Documentation-only</p>\n<p>The <a href=\"util.html#util_util_isnumber_object\"><code>util.isNumber()</code></a> API is deprecated.</p>\n<p><a id=\"DEP0053\"></a></p>",
              "type": "module",
              "displayName": "DEP0052: `util.isNumber()`"
            },
            {
              "textRaw": "DEP0053 `util.isObject()`",
              "name": "dep0053_`util.isobject()`",
              "meta": {
                "changes": [
                  {
                    "version": [
                      "v4.8.6",
                      "v6.12.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/10116",
                    "description": "A deprecation code has been assigned."
                  },
                  {
                    "version": [
                      "v3.3.1",
                      "v4.0.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/2447",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Documentation-only</p>\n<p>The <a href=\"util.html#util_util_isobject_object\"><code>util.isObject()</code></a> API is deprecated.</p>\n<p><a id=\"DEP0054\"></a></p>",
              "type": "module",
              "displayName": "DEP0053 `util.isObject()`"
            },
            {
              "textRaw": "DEP0054: `util.isPrimitive()`",
              "name": "dep0054:_`util.isprimitive()`",
              "meta": {
                "changes": [
                  {
                    "version": [
                      "v4.8.6",
                      "v6.12.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/10116",
                    "description": "A deprecation code has been assigned."
                  },
                  {
                    "version": [
                      "v3.3.1",
                      "v4.0.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/2447",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Documentation-only</p>\n<p>The <a href=\"util.html#util_util_isprimitive_object\"><code>util.isPrimitive()</code></a> API is deprecated.</p>\n<p><a id=\"DEP0055\"></a></p>",
              "type": "module",
              "displayName": "DEP0054: `util.isPrimitive()`"
            },
            {
              "textRaw": "DEP0055: `util.isRegExp()`",
              "name": "dep0055:_`util.isregexp()`",
              "meta": {
                "changes": [
                  {
                    "version": [
                      "v4.8.6",
                      "v6.12.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/10116",
                    "description": "A deprecation code has been assigned."
                  },
                  {
                    "version": [
                      "v3.3.1",
                      "v4.0.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/2447",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Documentation-only</p>\n<p>The <a href=\"util.html#util_util_isregexp_object\"><code>util.isRegExp()</code></a> API is deprecated.</p>\n<p><a id=\"DEP0056\"></a></p>",
              "type": "module",
              "displayName": "DEP0055: `util.isRegExp()`"
            },
            {
              "textRaw": "DEP0056: `util.isString()`",
              "name": "dep0056:_`util.isstring()`",
              "meta": {
                "changes": [
                  {
                    "version": [
                      "v4.8.6",
                      "v6.12.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/10116",
                    "description": "A deprecation code has been assigned."
                  },
                  {
                    "version": [
                      "v3.3.1",
                      "v4.0.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/2447",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Documentation-only</p>\n<p>The <a href=\"util.html#util_util_isstring_object\"><code>util.isString()</code></a> API is deprecated.</p>\n<p><a id=\"DEP0057\"></a></p>",
              "type": "module",
              "displayName": "DEP0056: `util.isString()`"
            },
            {
              "textRaw": "DEP0057: `util.isSymbol()`",
              "name": "dep0057:_`util.issymbol()`",
              "meta": {
                "changes": [
                  {
                    "version": [
                      "v4.8.6",
                      "v6.12.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/10116",
                    "description": "A deprecation code has been assigned."
                  },
                  {
                    "version": [
                      "v3.3.1",
                      "v4.0.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/2447",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Documentation-only</p>\n<p>The <a href=\"util.html#util_util_issymbol_object\"><code>util.isSymbol()</code></a> API is deprecated.</p>\n<p><a id=\"DEP0058\"></a></p>",
              "type": "module",
              "displayName": "DEP0057: `util.isSymbol()`"
            },
            {
              "textRaw": "DEP0058: `util.isUndefined()`",
              "name": "dep0058:_`util.isundefined()`",
              "meta": {
                "changes": [
                  {
                    "version": [
                      "v4.8.6",
                      "v6.12.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/10116",
                    "description": "A deprecation code has been assigned."
                  },
                  {
                    "version": [
                      "v3.3.1",
                      "v4.0.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/2447",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Documentation-only</p>\n<p>The <a href=\"util.html#util_util_isundefined_object\"><code>util.isUndefined()</code></a> API is deprecated.</p>\n<p><a id=\"DEP0059\"></a></p>",
              "type": "module",
              "displayName": "DEP0058: `util.isUndefined()`"
            },
            {
              "textRaw": "DEP0059: `util.log()`",
              "name": "dep0059:_`util.log()`",
              "meta": {
                "changes": [
                  {
                    "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: Documentation-only</p>\n<p>The <a href=\"util.html#util_util_log_string\"><code>util.log()</code></a> API is deprecated.</p>\n<p><a id=\"DEP0060\"></a></p>",
              "type": "module",
              "displayName": "DEP0059: `util.log()`"
            },
            {
              "textRaw": "DEP0060: `util._extend()`",
              "name": "dep0060:_`util._extend()`",
              "meta": {
                "changes": [
                  {
                    "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: Documentation-only</p>\n<p>The <a href=\"util.html#util_util_extend_target_source\"><code>util._extend()</code></a> API is deprecated.</p>\n<p><a id=\"DEP0061\"></a></p>",
              "type": "module",
              "displayName": "DEP0060: `util._extend()`"
            },
            {
              "textRaw": "DEP0061: `fs.SyncWriteStream`",
              "name": "dep0061:_`fs.syncwritestream`",
              "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>\n<p><a id=\"DEP0062\"></a></p>",
              "type": "module",
              "displayName": "DEP0061: `fs.SyncWriteStream`"
            },
            {
              "textRaw": "DEP0062: `node --debug`",
              "name": "dep0062:_`node_--debug`",
              "meta": {
                "changes": [
                  {
                    "version": "v8.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10970",
                    "description": "Runtime deprecation."
                  },
                  {
                    "version": "v12.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/25828",
                    "description": "End-of-Life."
                  }
                ]
              },
              "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>\n<p><a id=\"DEP0063\"></a></p>",
              "type": "module",
              "displayName": "DEP0062: `node --debug`"
            },
            {
              "textRaw": "DEP0063: `ServerResponse.prototype.writeHeader()`",
              "name": "dep0063:_`serverresponse.prototype.writeheader()`",
              "meta": {
                "changes": [
                  {
                    "version": "v8.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/11355",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Documentation-only</p>\n<p>The <code>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>\n<p><a id=\"DEP0064\"></a></p>",
              "type": "module",
              "displayName": "DEP0063: `ServerResponse.prototype.writeHeader()`"
            },
            {
              "textRaw": "DEP0064: `tls.createSecurePair()`",
              "name": "dep0064:_`tls.createsecurepair()`",
              "meta": {
                "changes": [
                  {
                    "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: Runtime</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>\n<p><a id=\"DEP0065\"></a></p>",
              "type": "module",
              "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`",
              "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>repl</code> module's <code>REPL_MODE_MAGIC</code> constant, used for <code>replMode</code> option, has\nbeen 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>\n<p><a id=\"DEP0066\"></a></p>",
              "type": "module",
              "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`",
              "meta": {
                "changes": [
                  {
                    "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: Runtime</p>\n<p>The <code>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.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><a id=\"DEP0067\"></a></p>",
              "type": "module",
              "displayName": "DEP0066: `OutgoingMessage.prototype._headers, OutgoingMessage.prototype._headerNames`"
            },
            {
              "textRaw": "DEP0067: `OutgoingMessage.prototype._renderHeaders`",
              "name": "dep0067:_`outgoingmessage.prototype._renderheaders`",
              "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>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>\n<p><a id=\"DEP0068\"></a></p>",
              "type": "module",
              "displayName": "DEP0067: `OutgoingMessage.prototype._renderHeaders`"
            },
            {
              "textRaw": "DEP0068: `node debug`",
              "name": "dep0068:_`node_debug`",
              "meta": {
                "changes": [
                  {
                    "version": "v8.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/11441",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Runtime</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>\n<p><a id=\"DEP0069\"></a></p>",
              "type": "module",
              "displayName": "DEP0068: `node debug`"
            },
            {
              "textRaw": "DEP0069: `vm.runInDebugContext(string)`",
              "name": "dep0069:_`vm.runindebugcontext(string)`",
              "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>\n<p><a id=\"DEP0070\"></a></p>",
              "type": "module",
              "displayName": "DEP0069: `vm.runInDebugContext(string)`"
            },
            {
              "textRaw": "DEP0070: `async_hooks.currentId()`",
              "name": "dep0070:_`async_hooks.currentid()`",
              "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>\n<p><a id=\"DEP0071\"></a></p>",
              "type": "module",
              "displayName": "DEP0070: `async_hooks.currentId()`"
            },
            {
              "textRaw": "DEP0071: `async_hooks.triggerId()`",
              "name": "dep0071:_`async_hooks.triggerid()`",
              "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>\n<p><a id=\"DEP0072\"></a></p>",
              "type": "module",
              "displayName": "DEP0071: `async_hooks.triggerId()`"
            },
            {
              "textRaw": "DEP0072: `async_hooks.AsyncResource.triggerId()`",
              "name": "dep0072:_`async_hooks.asyncresource.triggerid()`",
              "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>\n<p><a id=\"DEP0073\"></a></p>",
              "type": "module",
              "displayName": "DEP0072: `async_hooks.AsyncResource.triggerId()`"
            },
            {
              "textRaw": "DEP0073: Several internal properties of `net.Server`",
              "name": "dep0073:_several_internal_properties_of_`net.server`",
              "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>\n<p><a id=\"DEP0074\"></a></p>",
              "type": "module",
              "displayName": "DEP0073: Several internal properties of `net.Server`"
            },
            {
              "textRaw": "DEP0074: `REPLServer.bufferedCommand`",
              "name": "dep0074:_`replserver.bufferedcommand`",
              "meta": {
                "changes": [
                  {
                    "version": "v9.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/13687",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Runtime</p>\n<p>The <code>REPLServer.bufferedCommand</code> property was deprecated in favor of\n<a href=\"repl.html#repl_replserver_clearbufferedcommand\"><code>REPLServer.clearBufferedCommand()</code></a>.</p>\n<p><a id=\"DEP0075\"></a></p>",
              "type": "module",
              "displayName": "DEP0074: `REPLServer.bufferedCommand`"
            },
            {
              "textRaw": "DEP0075: `REPLServer.parseREPLKeyword()`",
              "name": "dep0075:_`replserver.parsereplkeyword()`",
              "meta": {
                "changes": [
                  {
                    "version": "v9.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/14223",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Runtime</p>\n<p><code>REPLServer.parseREPLKeyword()</code> was removed from userland visibility.</p>\n<p><a id=\"DEP0076\"></a></p>",
              "type": "module",
              "displayName": "DEP0075: `REPLServer.parseREPLKeyword()`"
            },
            {
              "textRaw": "DEP0076: `tls.parseCertString()`",
              "name": "dep0076:_`tls.parsecertstring()`",
              "meta": {
                "changes": [
                  {
                    "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: Runtime</p>\n<p><code>tls.parseCertString()</code> is a trivial parsing helper that was made public by\nmistake. This function can usually be replaced with:</p>\n<pre><code class=\"language-js\">const querystring = require('querystring');\nquerystring.parse(str, '\\n', '=');\n</code></pre>\n<p>This function is not completely equivalent to <code>querystring.parse()</code>. One\ndifference is that <code>querystring.parse()</code> does url decoding:</p>\n<pre><code class=\"language-console\">> querystring.parse('%E5%A5%BD=1', '\\n', '=');\n{ '好': '1' }\n> tls.parseCertString('%E5%A5%BD=1');\n{ '%E5%A5%BD': '1' }\n</code></pre>\n<p><a id=\"DEP0077\"></a></p>",
              "type": "module",
              "displayName": "DEP0076: `tls.parseCertString()`"
            },
            {
              "textRaw": "DEP0077: `Module._debug()`",
              "name": "dep0077:_`module._debug()`",
              "meta": {
                "changes": [
                  {
                    "version": "v9.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/13948",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Runtime</p>\n<p><code>Module._debug()</code> is deprecated.</p>\n<p>The <code>Module._debug()</code> function was never documented as an officially\nsupported API.</p>\n<p><a id=\"DEP0078\"></a></p>",
              "type": "module",
              "displayName": "DEP0077: `Module._debug()`"
            },
            {
              "textRaw": "DEP0078: `REPLServer.turnOffEditorMode()`",
              "name": "dep0078:_`replserver.turnoffeditormode()`",
              "meta": {
                "changes": [
                  {
                    "version": "v9.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/15136",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Runtime</p>\n<p><code>REPLServer.turnOffEditorMode()</code> was removed from userland visibility.</p>\n<p><a id=\"DEP0079\"></a></p>",
              "type": "module",
              "displayName": "DEP0078: `REPLServer.turnOffEditorMode()`"
            },
            {
              "textRaw": "DEP0079: Custom inspection function on objects via `.inspect()`",
              "name": "dep0079:_custom_inspection_function_on_objects_via_`.inspect()`",
              "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#util_util_inspect_object_options\"><code>util.inspect()</code></a> is deprecated. Use <a href=\"util.html#util_util_inspect_custom\"><code>util.inspect.custom</code></a>\ninstead. For backward compatibility with Node.js prior to version 6.4.0, both\nmay be specified.</p>\n<p><a id=\"DEP0080\"></a></p>",
              "type": "module",
              "displayName": "DEP0079: Custom inspection function on objects via `.inspect()`"
            },
            {
              "textRaw": "DEP0080: `path._makeLong()`",
              "name": "dep0080:_`path._makelong()`",
              "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>\n<p><a id=\"DEP0081\"></a></p>",
              "type": "module",
              "displayName": "DEP0080: `path._makeLong()`"
            },
            {
              "textRaw": "DEP0081: `fs.truncate()` using a file descriptor",
              "name": "dep0081:_`fs.truncate()`_using_a_file_descriptor",
              "meta": {
                "changes": [
                  {
                    "version": "v9.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/15990",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Runtime</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><a id=\"DEP0082\"></a></p>",
              "type": "module",
              "displayName": "DEP0081: `fs.truncate()` using a file descriptor"
            },
            {
              "textRaw": "DEP0082: `REPLServer.prototype.memory()`",
              "name": "dep0082:_`replserver.prototype.memory()`",
              "meta": {
                "changes": [
                  {
                    "version": "v9.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/16242",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Runtime</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>\n<p><a id=\"DEP0083\"></a></p>",
              "type": "module",
              "displayName": "DEP0082: `REPLServer.prototype.memory()`"
            },
            {
              "textRaw": "DEP0083: Disabling ECDH by setting `ecdhCurve` to `false`",
              "name": "dep0083:_disabling_ecdh_by_setting_`ecdhcurve`_to_`false`",
              "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>\n<p><a id=\"DEP0084\"></a></p>",
              "type": "module",
              "displayName": "DEP0083: Disabling ECDH by setting `ecdhCurve` to `false`"
            },
            {
              "textRaw": "DEP0084: requiring bundled internal dependencies",
              "name": "dep0084:_requiring_bundled_internal_dependencies",
              "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> may 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>\n<p><a id=\"DEP0085\"></a></p>",
              "type": "module",
              "displayName": "DEP0084: requiring bundled internal dependencies"
            },
            {
              "textRaw": "DEP0085: AsyncHooks sensitive API",
              "name": "dep0085:_asynchooks_sensitive_api",
              "meta": {
                "changes": [
                  {
                    "version": "10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/17147",
                    "description": "End-of-Life."
                  },
                  {
                    "version": [
                      "v8.10.0",
                      "v9.4.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>\n<p><a id=\"DEP0086\"></a></p>",
              "type": "module",
              "displayName": "DEP0085: AsyncHooks sensitive API"
            },
            {
              "textRaw": "DEP0086: Remove `runInAsyncIdScope`",
              "name": "dep0086:_remove_`runinasyncidscope`",
              "meta": {
                "changes": [
                  {
                    "version": "10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/17147",
                    "description": "End-of-Life."
                  },
                  {
                    "version": [
                      "v8.10.0",
                      "v9.4.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>\n<p><a id=\"DEP0089\"></a></p>",
              "type": "module",
              "displayName": "DEP0086: Remove `runInAsyncIdScope`"
            },
            {
              "textRaw": "DEP0089: `require('assert')`",
              "name": "dep0089:_`require('assert')`",
              "meta": {
                "changes": [
                  {
                    "version": "v12.8.0",
                    "pr-url": "https://github.com/nodejs/node/pull/28892",
                    "description": "Deprecation revoked."
                  },
                  {
                    "version": [
                      "v9.9.0",
                      "v10.0.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 <code>assert</code>\nmodule is not discouraged, and the deprecation caused end user confusion.</p>\n<p><a id=\"DEP0090\"></a></p>",
              "type": "module",
              "displayName": "DEP0089: `require('assert')`"
            },
            {
              "textRaw": "DEP0090: Invalid GCM authentication tag lengths",
              "name": "dep0090:_invalid_gcm_authentication_tag_lengths",
              "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#crypto_decipher_setauthtag_buffer\"><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>\n<p><a id=\"DEP0091\"></a></p>",
              "type": "module",
              "displayName": "DEP0090: Invalid GCM authentication tag lengths"
            },
            {
              "textRaw": "DEP0091: `crypto.DEFAULT_ENCODING`",
              "name": "dep0091:_`crypto.default_encoding`",
              "meta": {
                "changes": [
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/18333",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Runtime</p>\n<p>The <a href=\"crypto.html#crypto_crypto_default_encoding\"><code>crypto.DEFAULT_ENCODING</code></a> property is deprecated.</p>\n<p><a id=\"DEP0092\"></a></p>",
              "type": "module",
              "displayName": "DEP0091: `crypto.DEFAULT_ENCODING`"
            },
            {
              "textRaw": "DEP0092: Top-level `this` bound to `module.exports`",
              "name": "dep0092:_top-level_`this`_bound_to_`module.exports`",
              "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>\n<p><a id=\"DEP0093\"></a></p>",
              "type": "module",
              "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.",
              "meta": {
                "changes": [
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/18335",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Documentation-only</p>\n<p>The <a href=\"crypto.html#crypto_crypto_fips\"><code>crypto.fips</code></a> property is deprecated. Please use <code>crypto.setFips()</code>\nand <code>crypto.getFips()</code> instead.</p>\n<p><a id=\"DEP0094\"></a></p>",
              "type": "module",
              "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.",
              "meta": {
                "changes": [
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/18418",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Runtime</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>assert</code> module\nmethod.</p>\n<p><a id=\"DEP0095\"></a></p>",
              "type": "module",
              "displayName": "DEP0094: Using `assert.fail()` with more than one argument."
            },
            {
              "textRaw": "DEP0095: `timers.enroll()`",
              "name": "dep0095:_`timers.enroll()`",
              "meta": {
                "changes": [
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/18066",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Runtime</p>\n<p><code>timers.enroll()</code> is deprecated. Please use the publicly documented\n<a href=\"timers.html#timers_settimeout_callback_delay_args\"><code>setTimeout()</code></a> or <a href=\"timers.html#timers_setinterval_callback_delay_args\"><code>setInterval()</code></a> instead.</p>\n<p><a id=\"DEP0096\"></a></p>",
              "type": "module",
              "displayName": "DEP0095: `timers.enroll()`"
            },
            {
              "textRaw": "DEP0096: `timers.unenroll()`",
              "name": "dep0096:_`timers.unenroll()`",
              "meta": {
                "changes": [
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/18066",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Runtime</p>\n<p><code>timers.unenroll()</code> is deprecated. Please use the publicly documented\n<a href=\"timers.html#timers_cleartimeout_timeout\"><code>clearTimeout()</code></a> or <a href=\"timers.html#timers_clearinterval_timeout\"><code>clearInterval()</code></a> instead.</p>\n<p><a id=\"DEP0097\"></a></p>",
              "type": "module",
              "displayName": "DEP0096: `timers.unenroll()`"
            },
            {
              "textRaw": "DEP0097: `MakeCallback` with `domain` property",
              "name": "dep0097:_`makecallback`_with_`domain`_property",
              "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>\n<p><a id=\"DEP0098\"></a></p>",
              "type": "module",
              "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",
              "meta": {
                "changes": [
                  {
                    "version": "v12.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/26530",
                    "description": "End-of-Life"
                  },
                  {
                    "version": [
                      "v8.12.0",
                      "v9.6.0",
                      "v10.0.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_hooks.html#async_hooks_asyncresource_runinasyncscope_fn_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>\n<p><a id=\"DEP0099\"></a></p>",
              "type": "module",
              "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",
              "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 modules are\ndeprecated. Please use the versions of the API that accept an <code>async_context</code>\nparameter.</p>\n<p><a id=\"DEP0100\"></a></p>",
              "type": "module",
              "displayName": "DEP0099: Async context-unaware `node::MakeCallback` C++ APIs"
            },
            {
              "textRaw": "DEP0100: `process.assert()`",
              "name": "dep0100:_`process.assert()`",
              "meta": {
                "changes": [
                  {
                    "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: Runtime</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><a id=\"DEP0101\"></a></p>",
              "type": "module",
              "displayName": "DEP0100: `process.assert()`"
            },
            {
              "textRaw": "DEP0101: `--with-lttng`",
              "name": "dep0101:_`--with-lttng`",
              "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>\n<p><a id=\"DEP0102\"></a></p>",
              "type": "module",
              "displayName": "DEP0101: `--with-lttng`"
            },
            {
              "textRaw": "DEP0102: Using `noAssert` in `Buffer#(read|write)` operations.",
              "name": "dep0102:_using_`noassert`_in_`buffer#(read|write)`_operations.",
              "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 going\nto be verified, no matter if it is set to true or not. Skipping the verification\ncould lead to hard to find errors and crashes.</p>\n<p><a id=\"DEP0103\"></a></p>",
              "type": "module",
              "displayName": "DEP0102: Using `noAssert` in `Buffer#(read|write)` operations."
            },
            {
              "textRaw": "DEP0103: `process.binding('util').is[...]` typechecks",
              "name": "dep0103:_`process.binding('util').is[...]`_typechecks",
              "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#cli_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#util_util_types\"><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=\"deprecations.html#DEP0111\">DEP0111</a>).</p>\n<p><a id=\"DEP0104\"></a></p>",
              "type": "module",
              "displayName": "DEP0103: `process.binding('util').is[...]` typechecks"
            },
            {
              "textRaw": "DEP0104: `process.env` string coercion",
              "name": "dep0104:_`process.env`_string_coercion",
              "meta": {
                "changes": [
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/18990",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Documentation-only (supports <a href=\"cli.html#cli_pending_deprecation\"><code>--pending-deprecation</code></a>)</p>\n<p>When assigning a non-string property to <a href=\"process.html#process_process_env\"><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 may\nresult in a thrown error. Please convert the property to a string before\nassigning it to <code>process.env</code>.</p>\n<p><a id=\"DEP0105\"></a></p>",
              "type": "module",
              "displayName": "DEP0104: `process.env` string coercion"
            },
            {
              "textRaw": "DEP0105: `decipher.finaltol`",
              "name": "dep0105:_`decipher.finaltol`",
              "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#crypto_decipher_final_outputencoding\"><code>decipher.final()</code></a>. This API has been removed, and it is recommended to use\n<a href=\"crypto.html#crypto_decipher_final_outputencoding\"><code>decipher.final()</code></a> instead.</p>\n<p><a id=\"DEP0106\"></a></p>",
              "type": "module",
              "displayName": "DEP0105: `decipher.finaltol`"
            },
            {
              "textRaw": "DEP0106: `crypto.createCipher` and `crypto.createDecipher`",
              "name": "dep0106:_`crypto.createcipher`_and_`crypto.createdecipher`",
              "meta": {
                "changes": [
                  {
                    "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: Runtime</p>\n<p>Using <a href=\"crypto.html#crypto_crypto_createcipher_algorithm_password_options\"><code>crypto.createCipher()</code></a> and <a href=\"crypto.html#crypto_crypto_createdecipher_algorithm_password_options\"><code>crypto.createDecipher()</code></a> should be\navoided as they use a weak key derivation function (MD5 with no salt) and static\ninitialization vectors. It is recommended to derive a key using\n<a href=\"crypto.html#crypto_crypto_pbkdf2_password_salt_iterations_keylen_digest_callback\"><code>crypto.pbkdf2()</code></a> or <a href=\"crypto.html#crypto_crypto_scrypt_password_salt_keylen_options_callback\"><code>crypto.scrypt()</code></a> and to use\n<a href=\"crypto.html#crypto_crypto_createcipheriv_algorithm_key_iv_options\"><code>crypto.createCipheriv()</code></a> and <a href=\"crypto.html#crypto_crypto_createdecipheriv_algorithm_key_iv_options\"><code>crypto.createDecipheriv()</code></a> to obtain the\n<a href=\"crypto.html#crypto_class_cipher\"><code>Cipher</code></a> and <a href=\"crypto.html#crypto_class_decipher\"><code>Decipher</code></a> objects respectively.</p>\n<p><a id=\"DEP0107\"></a></p>",
              "type": "module",
              "displayName": "DEP0106: `crypto.createCipher` and `crypto.createDecipher`"
            },
            {
              "textRaw": "DEP0107: `tls.convertNPNProtocols()`",
              "name": "dep0107:_`tls.convertnpnprotocols()`",
              "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>\n<p><a id=\"DEP0108\"></a></p>",
              "type": "module",
              "displayName": "DEP0107: `tls.convertNPNProtocols()`"
            },
            {
              "textRaw": "DEP0108: `zlib.bytesRead`",
              "name": "dep0108:_`zlib.bytesread`",
              "meta": {
                "changes": [
                  {
                    "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: Runtime</p>\n<p>Deprecated alias for <a href=\"zlib.html#zlib_zlib_byteswritten\"><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><a id=\"DEP0109\"></a></p>",
              "type": "module",
              "displayName": "DEP0108: `zlib.bytesRead`"
            },
            {
              "textRaw": "DEP0109: `http`, `https`, and `tls` support for invalid URLs",
              "name": "dep0109:_`http`,_`https`,_and_`tls`_support_for_invalid_urls",
              "meta": {
                "changes": [
                  {
                    "version": "v11.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/20270",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Runtime</p>\n<p>Some previously supported (but strictly invalid) URLs were accepted through the\n<a href=\"http.html#http_http_request_options_callback\"><code>http.request()</code></a>, <a href=\"http.html#http_http_get_options_callback\"><code>http.get()</code></a>, <a href=\"https.html#https_https_request_options_callback\"><code>https.request()</code></a>,\n<a href=\"https.html#https_https_get_options_callback\"><code>https.get()</code></a>, and <a href=\"tls.html#tls_tls_checkserveridentity_hostname_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>\n<p><a id=\"DEP0110\"></a></p>",
              "type": "module",
              "displayName": "DEP0109: `http`, `https`, and `tls` support for invalid URLs"
            },
            {
              "textRaw": "DEP0110: `vm.Script` cached data",
              "name": "dep0110:_`vm.script`_cached_data",
              "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#vm_script_createcacheddata\"><code>script.createCachedData()</code></a> instead.</p>\n<p><a id=\"DEP0111\"></a></p>",
              "type": "module",
              "displayName": "DEP0110: `vm.Script` cached data"
            },
            {
              "textRaw": "DEP0111: `process.binding()`",
              "name": "dep0111:_`process.binding()`",
              "meta": {
                "changes": [
                  {
                    "version": "v10.9.0",
                    "pr-url": "https://github.com/nodejs/node/pull/22004",
                    "description": "Documentation-only deprecation."
                  },
                  {
                    "version": "v11.12.0",
                    "pr-url": "https://github.com/nodejs/node/pull/26500",
                    "description": "Added support for `--pending-deprecation`."
                  }
                ]
              },
              "desc": "<p>Type: Documentation-only (supports <a href=\"cli.html#cli_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><a id=\"DEP0112\"></a></p>",
              "type": "module",
              "displayName": "DEP0111: `process.binding()`"
            },
            {
              "textRaw": "DEP0112: `dgram` private APIs",
              "name": "dep0112:_`dgram`_private_apis",
              "meta": {
                "changes": [
                  {
                    "version": "v11.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/22011",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Runtime</p>\n<p>The <code>dgram</code> module previously contained several APIs that were never meant to\naccessed 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>.</p>\n<p><a id=\"DEP0113\"></a></p>",
              "type": "module",
              "displayName": "DEP0112: `dgram` private APIs"
            },
            {
              "textRaw": "DEP0113: `Cipher.setAuthTag()`, `Decipher.getAuthTag()`",
              "name": "dep0113:_`cipher.setauthtag()`,_`decipher.getauthtag()`",
              "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>\n<p><a id=\"DEP0114\"></a></p>",
              "type": "module",
              "displayName": "DEP0113: `Cipher.setAuthTag()`, `Decipher.getAuthTag()`"
            },
            {
              "textRaw": "DEP0114: `crypto._toBuf()`",
              "name": "dep0114:_`crypto._tobuf()`",
              "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>\n<p><a id=\"DEP0115\"></a></p>",
              "type": "module",
              "displayName": "DEP0114: `crypto._toBuf()`"
            },
            {
              "textRaw": "DEP0115: `crypto.prng()`, `crypto.pseudoRandomBytes()`, `crypto.rng()`",
              "name": "dep0115:_`crypto.prng()`,_`crypto.pseudorandombytes()`,_`crypto.rng()`",
              "meta": {
                "changes": [
                  {
                    "version": "v11.0.0",
                    "pr-url": [
                      "https://github.com/nodejs/node/pull/22519",
                      "https://github.com/nodejs/node/pull/23017"
                    ],
                    "description": "Added documentation-only deprecation with `--pending-deprecation` support."
                  }
                ]
              },
              "desc": "<p>Type: Documentation-only (supports <a href=\"cli.html#cli_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#crypto_crypto_randombytes_size_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#crypto_crypto_randombytes_size_callback\"><code>crypto.randomBytes()</code></a> and may be removed in a\nfuture release.</p>\n<p><a id=\"DEP0116\"></a></p>",
              "type": "module",
              "displayName": "DEP0115: `crypto.prng()`, `crypto.pseudoRandomBytes()`, `crypto.rng()`"
            },
            {
              "textRaw": "DEP0116: Legacy URL API",
              "name": "dep0116:_legacy_url_api",
              "meta": {
                "changes": [
                  {
                    "version": "v11.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/22715",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Documentation-only</p>\n<p>The <a href=\"url.html#url_legacy_url_api\">Legacy URL API</a> is deprecated. This includes <a href=\"url.html#url_url_format_urlobject\"><code>url.format()</code></a>,\n<a href=\"url.html#url_url_parse_urlstring_parsequerystring_slashesdenotehost\"><code>url.parse()</code></a>, <a href=\"url.html#url_url_resolve_from_to\"><code>url.resolve()</code></a>, and the <a href=\"url.html#url_legacy_urlobject\">legacy <code>urlObject</code></a>. Please\nuse the <a href=\"url.html#url_the_whatwg_url_api\">WHATWG URL API</a> instead.</p>\n<p><a id=\"DEP0117\"></a></p>",
              "type": "module",
              "displayName": "DEP0116: Legacy URL API"
            },
            {
              "textRaw": "DEP0117: Native crypto handles",
              "name": "dep0117:_native_crypto_handles",
              "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>\n<p><a id=\"DEP0118\"></a></p>",
              "type": "module",
              "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",
              "meta": {
                "changes": [
                  {
                    "version": "v11.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/23173",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Runtime</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.\nThis behavior is undocumented and is thought to be unused in real world apps.\nIt will become an error in future versions of Node.js.</p>\n<p><a id=\"DEP0119\"></a></p>",
              "type": "module",
              "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",
              "meta": {
                "changes": [
                  {
                    "version": "v11.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/23597",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Documentation-only (supports <a href=\"cli.html#cli_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#util_util_getsystemerrorname_err\"><code>util.getSystemErrorName()</code></a> instead.</p>\n<p><a id=\"DEP0120\"></a></p>",
              "type": "module",
              "displayName": "DEP0119: `process.binding('uv').errname()` private API"
            },
            {
              "textRaw": "DEP0120: Windows Performance Counter support",
              "name": "dep0120:_windows_performance_counter_support",
              "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>\n<p><a id=\"DEP0121\"></a></p>",
              "type": "module",
              "displayName": "DEP0120: Windows Performance Counter support"
            },
            {
              "textRaw": "DEP0121: `net._setSimultaneousAccepts()`",
              "name": "dep0121:_`net._setsimultaneousaccepts()`",
              "meta": {
                "changes": [
                  {
                    "version": "v12.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/23760",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Runtime</p>\n<p>The undocumented <code>net._setSimultaneousAccepts()</code> function was originally\nintended for debugging and performance tuning when using the <code>child_process</code>\nand <code>cluster</code> modules on Windows. The function is not generally useful and\nis being removed. See discussion here:\n<a href=\"https://github.com/nodejs/node/issues/18391\">https://github.com/nodejs/node/issues/18391</a></p>\n<p><a id=\"DEP0122\"></a></p>",
              "type": "module",
              "displayName": "DEP0121: `net._setSimultaneousAccepts()`"
            },
            {
              "textRaw": "DEP0122: `tls` `Server.prototype.setOptions()`",
              "name": "dep0122:_`tls`_`server.prototype.setoptions()`",
              "meta": {
                "changes": [
                  {
                    "version": "v12.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/23820",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Runtime</p>\n<p>Please use <code>Server.prototype.setSecureContext()</code> instead.</p>\n<p><a id=\"DEP0123\"></a></p>",
              "type": "module",
              "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",
              "meta": {
                "changes": [
                  {
                    "version": "v12.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/23329",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Runtime</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>. This will be ignored in a future version.</p>\n<p><a id=\"DEP0124\"></a></p>",
              "type": "module",
              "displayName": "DEP0123: setting the TLS ServerName to an IP address"
            },
            {
              "textRaw": "DEP0124: using `REPLServer.rli`",
              "name": "dep0124:_using_`replserver.rli`",
              "meta": {
                "changes": [
                  {
                    "version": "v12.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/26260",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Runtime</p>\n<p>This property is a reference to the instance itself.</p>\n<p><a id=\"DEP0125\"></a></p>",
              "type": "module",
              "displayName": "DEP0124: using `REPLServer.rli`"
            },
            {
              "textRaw": "DEP0125: `require('_stream_wrap')`",
              "name": "dep0125:_`require('_stream_wrap')`",
              "meta": {
                "changes": [
                  {
                    "version": "v12.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/26245",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Runtime</p>\n<p>The <code>_stream_wrap</code> module is deprecated.</p>\n<p><a id=\"DEP0126\"></a></p>",
              "type": "module",
              "displayName": "DEP0125: `require('_stream_wrap')`"
            },
            {
              "textRaw": "DEP0126: `timers.active()`",
              "name": "dep0126:_`timers.active()`",
              "meta": {
                "changes": [
                  {
                    "version": "v11.14.0",
                    "pr-url": "https://github.com/nodejs/node/pull/26760",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Runtime</p>\n<p>The previously undocumented <code>timers.active()</code> is deprecated.\nPlease use the publicly documented <a href=\"timers.html#timers_timeout_refresh\"><code>timeout.refresh()</code></a> instead.\nIf re-referencing the timeout is necessary, <a href=\"timers.html#timers_timeout_ref\"><code>timeout.ref()</code></a> can be used\nwith no performance impact since Node.js 10.</p>\n<p><a id=\"DEP0127\"></a></p>",
              "type": "module",
              "displayName": "DEP0126: `timers.active()`"
            },
            {
              "textRaw": "DEP0127: `timers._unrefActive()`",
              "name": "dep0127:_`timers._unrefactive()`",
              "meta": {
                "changes": [
                  {
                    "version": "v11.14.0",
                    "pr-url": "https://github.com/nodejs/node/pull/26760",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Runtime</p>\n<p>The previously undocumented and \"private\" <code>timers._unrefActive()</code> is deprecated.\nPlease use the publicly documented <a href=\"timers.html#timers_timeout_refresh\"><code>timeout.refresh()</code></a> instead.\nIf unreferencing the timeout is necessary, <a href=\"timers.html#timers_timeout_unref\"><code>timeout.unref()</code></a> can be used\nwith no performance impact since Node.js 10.</p>\n<p><a id=\"DEP0128\"></a></p>",
              "type": "module",
              "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",
              "meta": {
                "changes": [
                  {
                    "version": "v12.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/26823",
                    "description": "Documentation-only."
                  }
                ]
              },
              "desc": "<p>Type: Documentation-only (supports <a href=\"cli.html#cli_pending_deprecation\"><code>--pending-deprecation</code></a>)</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>\n<p><a id=\"DEP0129\"></a></p>",
              "type": "module",
              "displayName": "DEP0128: modules with an invalid `main` entry and an `index.js` file"
            },
            {
              "textRaw": "DEP0129: `ChildProcess._channel`",
              "name": "dep0129:_`childprocess._channel`",
              "meta": {
                "changes": [
                  {
                    "version": "v11.14.0",
                    "pr-url": "https://github.com/nodejs/node/pull/26982",
                    "description": "Documentation-only."
                  }
                ]
              },
              "desc": "<p>Type: Documentation-only</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>\n<p><a id=\"DEP0130\"></a></p>",
              "type": "module",
              "displayName": "DEP0129: `ChildProcess._channel`"
            },
            {
              "textRaw": "DEP0130: `Module.createRequireFromPath()`",
              "name": "dep0130:_`module.createrequirefrompath()`",
              "meta": {
                "changes": [
                  {
                    "version": "v12.2.0",
                    "pr-url": "https://github.com/nodejs/node/pull/27405",
                    "description": "Documentation-only."
                  }
                ]
              },
              "desc": "<p>Type: Documentation-only</p>\n<p>Module.createRequireFromPath() is deprecated. Please use <a href=\"modules.html#modules_module_createrequire_filename\"><code>module.createRequire()</code></a> instead.</p>\n<p><a id=\"DEP0131\"></a></p>",
              "type": "module",
              "displayName": "DEP0130: `Module.createRequireFromPath()`"
            },
            {
              "textRaw": "DEP0131: Legacy HTTP parser",
              "name": "dep0131:_legacy_http_parser",
              "meta": {
                "changes": [
                  {
                    "version": "v12.3.0",
                    "pr-url": "https://github.com/nodejs/node/pull/27498",
                    "description": "Documentation-only."
                  }
                ]
              },
              "desc": "<p>Type: Documentation-only</p>\n<p>The legacy HTTP parser, used by default in versions of Node.js prior to 12.0.0,\nis deprecated. This deprecation applies to users of the\n<a href=\"cli.html#cli_http_parser_library\"><code>--http-parser=legacy</code></a> command-line flag.</p>\n<p><a id=\"DEP0132\"></a></p>",
              "type": "module",
              "displayName": "DEP0131: Legacy HTTP parser"
            },
            {
              "textRaw": "DEP0132: `worker.terminate()` with callback",
              "name": "dep0132:_`worker.terminate()`_with_callback",
              "meta": {
                "changes": [
                  {
                    "version": "v12.5.0",
                    "pr-url": "https://github.com/nodejs/node/pull/28021",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Runtime</p>\n<p>Passing a callback to <a href=\"worker_threads.html#worker_threads_worker_terminate\"><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>\n<p><a id=\"DEP0133\"></a></p>",
              "type": "module",
              "displayName": "DEP0132: `worker.terminate()` with callback"
            },
            {
              "textRaw": "DEP0133: `http` `connection`",
              "name": "dep0133:_`http`_`connection`",
              "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#http_response_socket\"><code>response.socket</code></a> over <a href=\"http.html#http_response_connection\"><code>response.connection</code></a> and\n<a href=\"http.html#http_request_socket\"><code>request.socket</code></a> over <a href=\"http.html#http_request_connection\"><code>request.connection</code></a>.</p>\n<p><a id=\"DEP0134\"></a></p>",
              "type": "module",
              "displayName": "DEP0133: `http` `connection`"
            },
            {
              "textRaw": "DEP0134: `process._tickCallback`",
              "name": "dep0134:_`process._tickcallback`",
              "meta": {
                "changes": [
                  {
                    "version": "v12.12.0",
                    "pr-url": "https://github.com/nodejs/node/pull/29781",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Documentation-only (supports <a href=\"cli.html#cli_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>\n<p><a id=\"DEP0136\"></a></p>",
              "type": "module",
              "displayName": "DEP0134: `process._tickCallback`"
            },
            {
              "textRaw": "DEP0136: `http` `finished`",
              "name": "dep0136:_`http`_`finished`",
              "meta": {
                "changes": [
                  {
                    "version": "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=\"deprecations.html#http_response_finished\"><code>response.finished</code></a> indicates whether <a href=\"http.html#http_response_end_data_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=\"deprecations.html#http_response_writablefinished\"><code>response.writableFinished</code></a> or <a href=\"deprecations.html#http_response_writableended\"><code>response.writableEnded</code></a>\naccordingly instead to avoid the ambigiuty.</p>\n<p>To maintain existing behaviour <code>response.finished</code> should be replaced with\n<code>response.writableEnded</code>.</p>",
              "type": "module",
              "displayName": "DEP0136: `http` `finished`"
            }
          ],
          "type": "misc",
          "displayName": "List of deprecated APIs"
        }
      ]
    },
    {
      "textRaw": "ECMAScript modules",
      "name": "ECMAScript modules",
      "introduced_in": "v8.5.0",
      "type": "misc",
      "stability": 1,
      "stabilityText": "Experimental",
      "miscs": [
        {
          "textRaw": "Introduction",
          "name": "esm",
          "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 limited interoperability between them and the existing module format,\n<a href=\"modules.html\">CommonJS</a>.</p>\n<p>Node.js contains support for ES Modules based upon the\n<a href=\"https://github.com/nodejs/node-eps/blob/master/002-es-modules.md\">Node.js EP for ES Modules</a> and the <a href=\"https://github.com/nodejs/modules/blob/master/doc/plan-for-new-modules-implementation.md\">ECMAScript-modules implementation</a>.</p>\n<p>Expect major changes in the implementation including interoperability support,\nspecifier resolution, and default behavior.</p>",
          "type": "misc",
          "displayName": "esm"
        },
        {
          "textRaw": "Enabling",
          "name": "Enabling",
          "type": "misc",
          "desc": "<p>Experimental support for ECMAScript modules is enabled by default.\nNode.js will treat the following as ES modules when passed to <code>node</code> as the\ninitial input, or when referenced by <code>import</code> statements within ES module code:</p>\n<ul>\n<li>\n<p>Files ending in <code>.mjs</code>.</p>\n</li>\n<li>\n<p>Files ending in <code>.js</code> when the nearest parent <code>package.json</code> file contains a\ntop-level field <code>\"type\"</code> 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 <code>--print</code>, or piped to\n<code>node</code> via <code>STDIN</code>, with the flag <code>--input-type=module</code>.</p>\n</li>\n</ul>\n<p>Node.js will treat as CommonJS all other forms of input, such as <code>.js</code> files\nwhere the nearest parent <code>package.json</code> file contains no top-level <code>\"type\"</code>\nfield, or string input without the flag <code>--input-type</code>. This behavior is to\npreserve backward compatibility. However, now that Node.js supports both\nCommonJS and ES modules, it is best to be explicit whenever possible. Node.js\nwill treat the following as CommonJS when passed to <code>node</code> as the initial input,\nor when referenced by <code>import</code> statements within ES module code:</p>\n<ul>\n<li>\n<p>Files ending in <code>.cjs</code>.</p>\n</li>\n<li>\n<p>Files ending in <code>.js</code> when the nearest parent <code>package.json</code> file contains a\ntop-level field <code>\"type\"</code> 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\n<code>node</code> via <code>STDIN</code>, with the flag <code>--input-type=commonjs</code>.</p>\n</li>\n</ul>",
          "miscs": [
            {
              "textRaw": "`package.json` `\"type\"` field",
              "name": "`package.json`_`\"type\"`_field",
              "desc": "<p>Files ending with <code>.js</code> will be 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 the root of the volume is reached.</p>\n<!-- eslint-skip -->\n<pre><code class=\"language-js\">// package.json\n{\n  \"type\": \"module\"\n}\n</code></pre>\n<pre><code class=\"language-bash\"># In same folder as above 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 CommonJS. If the volume root is\nreached and no <code>package.json</code> is found, Node.js defers to the default, a\n<code>package.json</code> with no <code>\"type\"</code> field.</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>Package authors should include the <code>\"type\"</code> field, even in packages where all\nsources are CommonJS. Being explicit about the <code>type</code> of the package will\nfuture-proof the package in case the default type of Node.js ever changes, and\nit will also make things easier for build tools and loaders to determine how the\nfiles in the package should be interpreted.</p>\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>",
              "type": "misc",
              "displayName": "`package.json` `\"type\"` field"
            },
            {
              "textRaw": "Package scope and file extensions",
              "name": "package_scope_and_file_extensions",
              "desc": "<p>A folder containing a <code>package.json</code> file, and all subfolders below that folder\ndown until the next folder containing another <code>package.json</code>, is considered a\n<em>package scope</em>. The <code>\"type\"</code> field defines how <code>.js</code> files should be treated\nwithin a particular <code>package.json</code> file’s package scope. Every package in a\nproject’s <code>node_modules</code> folder contains its own <code>package.json</code> file, so each\nproject’s dependencies have their own package scopes. A <code>package.json</code> lacking a\n<code>\"type\"</code> field is treated as if it contained <code>\"type\": \"commonjs\"</code>.</p>\n<p>The package scope 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, in an ES module package scope 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 ES module package scope 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 ES modules regardless of package\nscope.</p>\n<p>Files ending with <code>.cjs</code> are always loaded as CommonJS regardless of package\nscope.</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 may be used to mix types within the same\npackage scope:</p>\n<ul>\n<li>\n<p>Within a <code>\"type\": \"module\"</code> package scope, Node.js can be instructed to\ninterpret a particular file as CommonJS by naming it with a <code>.cjs</code> extension\n(since both <code>.js</code> and <code>.mjs</code> files are treated as ES modules within a\n<code>\"module\"</code> package scope).</p>\n</li>\n<li>\n<p>Within a <code>\"type\": \"commonjs\"</code> package scope, Node.js can be instructed to\ninterpret a particular file as an ES module 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 scope).</p>\n</li>\n</ul>",
              "type": "misc",
              "displayName": "Package scope and file extensions"
            },
            {
              "textRaw": "`--input-type` flag",
              "name": "`--input-type`_flag",
              "desc": "<p>Strings passed in as an argument to <code>--eval</code> or <code>--print</code> (or <code>-e</code> or <code>-p</code>), or\npiped to <code>node</code> via <code>STDIN</code>, will be treated as ES modules when the\n<code>--input-type=module</code> flag is set.</p>\n<pre><code class=\"language-bash\">node --input-type=module --eval \"import { sep } from 'path'; console.log(sep);\"\n\necho \"import { sep } from '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>",
              "type": "misc",
              "displayName": "`--input-type` flag"
            }
          ]
        },
        {
          "textRaw": "Packages",
          "name": "packages",
          "modules": [
            {
              "textRaw": "Package entry points",
              "name": "package_entry_points",
              "desc": "<p>In a package’s <code>package.json</code> file, two fields can define entry points for a\npackage: <code>\"main\"</code> and <code>\"exports\"</code>. The <code>\"main\"</code> field is supported in all\nversions of Node.js, but its capabilities are limited: it only defines the main\nentry point of the package.</p>\n<p>The <code>\"exports\"</code> field provides an alternative to <code>\"main\"</code> where the package\nmain entry point can be defined while also encapsulating the package,\n<strong>preventing any other entry points besides those defined in <code>\"exports\"</code></strong>.\nThis encapsulation allows module authors to define a public interface for\ntheir package.</p>\n<p>If both <code>\"exports\"</code> and <code>\"main\"</code> are defined, the <code>\"exports\"</code> field takes\nprecedence over <code>\"main\"</code>. <code>\"exports\"</code> are not specific to ES modules or\nCommonJS; <code>\"main\"</code> will be overridden by <code>\"exports\"</code> if it exists. As such\n<code>\"main\"</code> cannot be used as a fallback for CommonJS but it can be used as a\nfallback for legacy versions of Node.js that do not support the <code>\"exports\"</code>\nfield.</p>\n<p><a href=\"esm.html#esm_conditional_exports\">Conditional exports</a> can 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>. For more information about supporting\nboth CommonJS and ES Modules in a single package please consult\n<a href=\"esm.html#esm_dual_commonjs_es_module_packages\">the dual CommonJS/ES module packages section</a>.</p>\n<p><strong>Warning</strong>: Introducing the <code>\"exports\"</code> field prevents consumers of a package\nfrom using any entry points that are not defined, including the <code>package.json</code>\n(e.g. <code>require('your-package/package.json')</code>. <strong>This will likely be a breaking\nchange.</strong></p>\n<p>To make the introduction of <code>\"exports\"</code> 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 previous 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-mod\",\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.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:</p>\n<pre><code class=\"language-json\">{\n  \"name\": \"my-mod\",\n  \"exports\": {\n    \".\": \"./lib/index.js\",\n    \"./lib\": \"./lib/index.js\",\n    \"./lib/\": \"./lib/\",\n    \"./feature\": \"./feature/index.js\",\n    \"./feature/\": \"./feature/\",\n    \"./package.json\": \"./package.json\"\n  }\n}\n</code></pre>\n<p>As a last resort, package encapsulation can be disabled entirely by creating an\nexport for the root of the package <code>\"./\": \"./\"</code>. This will expose every file in\nthe package at the cost of disabling the encapsulation and potential tooling\nbenefits this provides. As the ES Module loader in Node.js enforces the use of\n<a href=\"esm.html#esm_mandatory_file_extensions\">the full specifier path</a>, exporting the root rather than being explicit\nabout entry is less expressive than either of the prior examples. Not only\nwill encapsulation be lost but module consumers will be unable to\n<code>import feature from 'my-mod/feature'</code> as they will need to provide the full\npath <code>import feature from 'my-mod/feature/index.js</code>.</p>",
              "modules": [
                {
                  "textRaw": "Main entry point export",
                  "name": "main_entry_point_export",
                  "desc": "<p>To set the main entry point for a package, it is advisable to define both\n<code>\"exports\"</code> and <code>\"main\"</code> in the package’s <code>package.json</code> file:</p>\n<!-- eslint-skip -->\n<pre><code class=\"language-js\">{\n  \"main\": \"./main.js\",\n  \"exports\": \"./main.js\"\n}\n</code></pre>\n<p>The benefit of doing this is that when using the <code>\"exports\"</code> field all\nsubpaths of the package will no longer be available to importers under\n<code>require('pkg/subpath.js')</code>, and instead they will get a new error,\n<code>ERR_PACKAGE_PATH_NOT_EXPORTED</code>.</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>",
                  "type": "module",
                  "displayName": "Main entry point export"
                },
                {
                  "textRaw": "Subpath exports",
                  "name": "subpath_exports",
                  "desc": "<p>When using the <code>\"exports\"</code> 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<!-- eslint-skip -->\n<pre><code class=\"language-js\">{\n  \"main\": \"./main.js\",\n  \"exports\": {\n    \".\": \"./main.js\",\n    \"./submodule\": \"./src/submodule.js\"\n  }\n}\n</code></pre>\n<p>Now only the defined subpath in <code>\"exports\"</code> can be imported by a\nconsumer:</p>\n<pre><code class=\"language-js\">import submodule from 'es-module-package/submodule';\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>\n<p>Entire folders can also be mapped with package exports:</p>\n<!-- eslint-skip -->\n<pre><code class=\"language-js\">// ./node_modules/es-module-package/package.json\n{\n  \"exports\": {\n    \"./features/\": \"./src/features/\"\n  }\n}\n</code></pre>\n<p>With the above, all modules within the <code>./src/features/</code> folder\nare exposed deeply to <code>import</code> and <code>require</code>:</p>\n<pre><code class=\"language-js\">import feature from 'es-module-package/features/x.js';\n// Loads ./node_modules/es-module-package/src/features/x.js\n</code></pre>\n<p>When using folder mappings, ensure that you do want to expose every\nmodule inside the subfolder. Any modules which are not public\nshould be moved to another folder to retain the encapsulation\nbenefits of exports.</p>",
                  "type": "module",
                  "displayName": "Subpath exports"
                },
                {
                  "textRaw": "Package exports fallbacks",
                  "name": "package_exports_fallbacks",
                  "desc": "<p>For possible new specifier support in future, array fallbacks are\nsupported for all invalid specifiers:</p>\n<!-- eslint-skip -->\n<pre><code class=\"language-js\">{\n  \"exports\": {\n    \"./submodule\": [\"not:valid\", \"./submodule.js\"]\n  }\n}\n</code></pre>\n<p>Since <code>\"not:valid\"</code> is not a valid specifier, <code>\"./submodule.js\"</code> is used\ninstead as the fallback, as if it were the only target.</p>",
                  "type": "module",
                  "displayName": "Package exports fallbacks"
                },
                {
                  "textRaw": "Exports sugar",
                  "name": "exports_sugar",
                  "desc": "<p>If the <code>\".\"</code> export is the only export, the <code>\"exports\"</code> field provides sugar\nfor this case being the direct <code>\"exports\"</code> field value.</p>\n<p>If the <code>\".\"</code> export has a fallback array or string value, then the <code>\"exports\"</code>\nfield can be set to this value directly.</p>\n<!-- eslint-skip -->\n<pre><code class=\"language-js\">{\n  \"exports\": {\n    \".\": \"./main.js\"\n  }\n}\n</code></pre>\n<p>can be written:</p>\n<!-- eslint-skip -->\n<pre><code class=\"language-js\">{\n  \"exports\": \"./main.js\"\n}\n</code></pre>",
                  "type": "module",
                  "displayName": "Exports sugar"
                },
                {
                  "textRaw": "Conditional exports",
                  "name": "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<!-- eslint-skip -->\n<pre><code class=\"language-js\">// package.json\n{\n  \"main\": \"./main-require.cjs\",\n  \"exports\": {\n    \"import\": \"./main-module.js\",\n    \"require\": \"./main-require.cjs\"\n  },\n  \"type\": \"module\"\n}\n</code></pre>\n<p>Node.js supports the following conditions:</p>\n<ul>\n<li><code>\"import\"</code> - matched when the package is loaded via <code>import</code> or\n<code>import()</code>. Can reference either an ES module or CommonJS file, as both\n<code>import</code> and <code>import()</code> can load either ES module or CommonJS sources.</li>\n<li><code>\"require\"</code> - matched when the package is loaded via <code>require()</code>.\nAs <code>require()</code> only supports CommonJS, the referenced file must be CommonJS.</li>\n<li><code>\"node\"</code> - matched for any Node.js environment. Can be a CommonJS or ES\nmodule file. <em>This condition should always come after <code>\"import\"</code> or\n<code>\"require\"</code>.</em></li>\n<li><code>\"default\"</code> - the generic fallback that will always match. Can be a CommonJS\nor ES module file. <em>This condition should always come last.</em></li>\n</ul>\n<p>Condition matching is applied in object order from first to last within the\n<code>\"exports\"</code> object. <em>The general rule is that conditions should be used\nfrom most specific to least specific in object order.</em></p>\n<p>Other conditions such as <code>\"browser\"</code>, <code>\"electron\"</code>, <code>\"deno\"</code>, <code>\"react-native\"</code>,\netc. are ignored by Node.js but may be used by other runtimes or tools.\nFurther restrictions, definitions or guidance on condition names may be\nprovided in the future.</p>\n<p>Using the <code>\"import\"</code> and <code>\"require\"</code> conditions can lead to some hazards,\nwhich are explained further in\n<a href=\"esm.html#esm_dual_commonjs_es_module_packages\">the dual CommonJS/ES module packages section</a>.</p>\n<p>Conditional exports can also be extended to exports subpaths, for example:</p>\n<!-- eslint-skip -->\n<pre><code class=\"language-js\">{\n  \"main\": \"./main.js\",\n  \"exports\": {\n    \".\": \"./main.js\",\n    \"./feature\": {\n      \"browser\": \"./feature-browser.js\",\n      \"default\": \"./feature.js\"\n    }\n  }\n}\n</code></pre>\n<p>Defines a package where <code>require('pkg/feature')</code> and <code>import 'pkg/feature'</code>\ncould provide different implementations between the browser and Node.js,\ngiven third-party tool support for a <code>\"browser\"</code> condition.</p>",
                  "type": "module",
                  "displayName": "Conditional exports"
                },
                {
                  "textRaw": "Nested conditions",
                  "name": "nested_conditions",
                  "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<!-- eslint-skip -->\n<pre><code class=\"language-js\">{\n  \"main\": \"./main.js\",\n  \"exports\": {\n    \"browser\": \"./feature-browser.mjs\",\n    \"node\": {\n      \"import\": \"./feature-node.mjs\",\n      \"require\": \"./feature-node.cjs\"\n    }\n  }\n}\n</code></pre>\n<p>Conditions continue to be matched in order as with flat conditions. If\na nested conditional 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>",
                  "type": "module",
                  "displayName": "Nested conditions"
                },
                {
                  "textRaw": "Self-referencing a package using its name",
                  "name": "self-referencing_a_package_using_its_name",
                  "desc": "<p>Within a package, the values defined in the package’s\n<code>package.json</code> <code>\"exports\"</code> 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    \".\": \"./main.mjs\",\n    \"./foo\": \"./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 ./main.mjs.\n</code></pre>\n<p>Self-referencing is available only if <code>package.json</code> has <code>exports</code>, and will\nallow importing only what that <code>exports</code> (in the <code>package.json</code>) allows.\nSo the code below, given the package above, will generate a runtime error:</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-js\">// ./a-module.js\nconst { something } = require('a-package/foo'); // Loads from ./foo.js.\n</code></pre>",
                  "type": "module",
                  "displayName": "Self-referencing a package using its name"
                }
              ],
              "type": "module",
              "displayName": "Package entry points"
            },
            {
              "textRaw": "Dual CommonJS/ES module packages",
              "name": "dual_commonjs/es_module_packages",
              "desc": "<p>Prior to the introduction of support for ES modules in Node.js, it was a common\npattern for package authors to include both CommonJS and ES module JavaScript\nsources in their package, with <code>package.json</code> <code>\"main\"</code> specifying the CommonJS\nentry point and <code>package.json</code> <code>\"module\"</code> specifying the ES module entry point.\nThis enabled Node.js to run the CommonJS entry point while build tools such as\nbundlers used the ES module entry point, since Node.js ignored (and still\nignores) the top-level <code>\"module\"</code> field.</p>\n<p>Node.js can now run ES module entry points, and a package can contain both\nCommonJS and ES module entry points (either via separate specifiers such as\n<code>'pkg'</code> and <code>'pkg/es-module'</code>, or both at the same specifier via <a href=\"esm.html#esm_conditional_exports\">Conditional\nexports</a>). Unlike in the scenario where <code>\"module\"</code> is only used by bundlers,\nor ES module files are transpiled into CommonJS on the fly before evaluation by\nNode.js, the files referenced by the ES module entry point are evaluated as ES\nmodules.</p>",
              "modules": [
                {
                  "textRaw": "Dual package hazard",
                  "name": "dual_package_hazard",
                  "desc": "<p>When an application is using a package that provides both CommonJS and ES module\nsources, there is a risk of certain bugs if both versions of the package get\nloaded. This potential comes from the fact that the <code>pkgInstance</code> created by\n<code>const pkgInstance = require('pkg')</code> is not the same as the <code>pkgInstance</code>\ncreated by <code>import pkgInstance from 'pkg'</code> (or an alternative main path like\n<code>'pkg/module'</code>). This is the “dual package hazard,” where two versions of the\nsame package can be loaded within the same runtime environment. While it is\nunlikely that an application or package would intentionally load both versions\ndirectly, it is common for an application to load one version while a dependency\nof the application loads the other version. This hazard can happen because\nNode.js supports intermixing CommonJS and ES modules, and can lead to unexpected\nbehavior.</p>\n<p>If the package main export is a constructor, an <code>instanceof</code> comparison of\ninstances created by the two versions returns <code>false</code>, and if the export is an\nobject, properties added to one (like <code>pkgInstance.foo = 3</code>) are not present on\nthe other. This differs from how <code>import</code> and <code>require</code> statements work in\nall-CommonJS or all-ES module environments, respectively, and therefore is\nsurprising to users. It also differs from the behavior users are familiar with\nwhen using transpilation via tools like <a href=\"https://babeljs.io/\">Babel</a> or <a href=\"https://github.com/standard-things/esm#readme\"><code>esm</code></a>.</p>",
                  "type": "module",
                  "displayName": "Dual package hazard"
                },
                {
                  "textRaw": "Writing dual packages while avoiding or minimizing hazards",
                  "name": "writing_dual_packages_while_avoiding_or_minimizing_hazards",
                  "desc": "<p>First, the hazard described in the previous section occurs when a package\ncontains both CommonJS and ES module sources and both sources are provided for\nuse in Node.js, either via separate main entry points or exported paths. A\npackage could instead be written where any version of Node.js receives only\nCommonJS sources, and any separate ES module sources the package may contain\ncould be intended only for other environments such as browsers. Such a package\nwould be usable by any version of Node.js, since <code>import</code> can refer to CommonJS\nfiles; but it would not provide any of the advantages of using ES module syntax.</p>\n<p>A package could also switch from CommonJS to ES module syntax in a breaking\nchange version bump. This has the disadvantage that the newest version\nof the package would only be usable in ES module-supporting versions of Node.js.</p>\n<p>Every pattern has tradeoffs, but there are two broad approaches that satisfy the\nfollowing conditions:</p>\n<ol>\n<li>The package is usable via both <code>require</code> and <code>import</code>.</li>\n<li>The package is usable in both current Node.js and older versions of Node.js\nthat lack support for ES modules.</li>\n<li>The package main entry point, e.g. <code>'pkg'</code> can be used by both <code>require</code> to\nresolve to a CommonJS file and by <code>import</code> to resolve to an ES module file.\n(And likewise for exported paths, e.g. <code>'pkg/feature'</code>.)</li>\n<li>The package provides named exports, e.g. <code>import { name } from 'pkg'</code> rather\nthan <code>import pkg from 'pkg'; pkg.name</code>.</li>\n<li>The package is potentially usable in other ES module environments such as\nbrowsers.</li>\n<li>The hazards described in the previous section are avoided or minimized.</li>\n</ol>",
                  "modules": [
                    {
                      "textRaw": "Approach #1: Use an ES module wrapper",
                      "name": "approach_#1:_use_an_es_module_wrapper",
                      "desc": "<p>Write the package in CommonJS or transpile ES module sources into CommonJS, and\ncreate an ES module wrapper file that defines the named exports. Using\n<a href=\"esm.html#esm_conditional_exports\">Conditional exports</a>, the ES module wrapper is used for <code>import</code> and the\nCommonJS entry point for <code>require</code>.</p>\n<!-- eslint-skip -->\n<pre><code class=\"language-js\">// ./node_modules/pkg/package.json\n{\n  \"type\": \"module\",\n  \"main\": \"./index.cjs\",\n  \"exports\": {\n    \"import\": \"./wrapper.mjs\",\n    \"require\": \"./index.cjs\"\n  }\n}\n</code></pre>\n<pre><code class=\"language-js\">// ./node_modules/pkg/index.cjs\nexports.name = 'value';\n</code></pre>\n<pre><code class=\"language-js\">// ./node_modules/pkg/wrapper.mjs\nimport cjsModule from './index.cjs';\nexport const name = cjsModule.name;\n</code></pre>\n<p>In this example, the <code>name</code> from <code>import { name } from 'pkg'</code> is the same\nsingleton as the <code>name</code> from <code>const { name } = require('pkg')</code>. Therefore <code>===</code>\nreturns <code>true</code> when comparing the two <code>name</code>s and the divergent specifier hazard\nis avoided.</p>\n<p>If the module is not simply a list of named exports, but rather contains a\nunique function or object export like <code>module.exports = function () { ... }</code>,\nor if support in the wrapper for the <code>import pkg from 'pkg'</code> pattern is desired,\nthen the wrapper would instead be written to export the default optionally\nalong with any named exports as well:</p>\n<pre><code class=\"language-js\">import cjsModule from './index.cjs';\nexport const name = cjsModule.name;\nexport default cjsModule;\n</code></pre>\n<p>This approach is appropriate for any of the following use cases:</p>\n<ul>\n<li>The package is currently written in CommonJS and the author would prefer not\nto refactor it into ES module syntax, but wishes to provide named exports for\nES module consumers.</li>\n<li>The package has other packages that depend on it, and the end user might\ninstall both this package and those other packages. For example a <code>utilities</code>\npackage is used directly in an application, and a <code>utilities-plus</code> package\nadds a few more functions to <code>utilities</code>. Because the wrapper exports\nunderlying CommonJS files, it doesn’t matter if <code>utilities-plus</code> is written in\nCommonJS or ES module syntax; it will work either way.</li>\n<li>The package stores internal state, and the package author would prefer not to\nrefactor the package to isolate its state management. See the next section.</li>\n</ul>\n<p>A variant of this approach not requiring conditional exports for consumers could\nbe to add an export, e.g. <code>\"./module\"</code>, to point to an all-ES module-syntax\nversion of the package. This could be used via <code>import 'pkg/module'</code> by users\nwho are certain that the CommonJS version will not be loaded anywhere in the\napplication, such as by dependencies; or if the CommonJS version can be loaded\nbut doesn’t affect the ES module version (for example, because the package is\nstateless):</p>\n<!-- eslint-skip -->\n<pre><code class=\"language-js\">// ./node_modules/pkg/package.json\n{\n  \"type\": \"module\",\n  \"main\": \"./index.cjs\",\n  \"exports\": {\n    \".\": \"./index.cjs\",\n    \"./module\": \"./wrapper.mjs\"\n  }\n}\n</code></pre>",
                      "type": "module",
                      "displayName": "Approach #1: Use an ES module wrapper"
                    },
                    {
                      "textRaw": "Approach #2: Isolate state",
                      "name": "approach_#2:_isolate_state",
                      "desc": "<p>A <code>package.json</code> file can define the separate CommonJS and ES module entry\npoints directly:</p>\n<!-- eslint-skip -->\n<pre><code class=\"language-js\">// ./node_modules/pkg/package.json\n{\n  \"type\": \"module\",\n  \"main\": \"./index.cjs\",\n  \"exports\": {\n    \"import\": \"./index.mjs\",\n    \"require\": \"./index.cjs\"\n  }\n}\n</code></pre>\n<p>This can be done if both the CommonJS and ES module versions of the package are\nequivalent, for example because one is the transpiled output of the other; and\nthe package’s management of state is carefully isolated (or the package is\nstateless).</p>\n<p>The reason that state is an issue is because both the CommonJS and ES module\nversions of the package may get used within an application; for example, the\nuser’s application code could <code>import</code> the ES module version while a dependency\n<code>require</code>s the CommonJS version. If that were to occur, two copies of the\npackage would be loaded in memory and therefore two separate states would be\npresent. This would likely cause hard-to-troubleshoot bugs.</p>\n<p>Aside from writing a stateless package (if JavaScript’s <code>Math</code> were a package,\nfor example, it would be stateless as all of its methods are static), there are\nsome ways to isolate state so that it’s shared between the potentially loaded\nCommonJS and ES module instances of the package:</p>\n<ol>\n<li>\n<p>If possible, contain all state within an instantiated object. JavaScript’s\n<code>Date</code>, for example, needs to be instantiated to contain state; if it were a\npackage, it would be used like this:</p>\n<pre><code class=\"language-js\">import Date from 'date';\nconst someDate = new Date();\n// someDate contains state; Date does not\n</code></pre>\n<p>The <code>new</code> keyword isn’t required; a package’s function can return a new\nobject, or modify a passed-in object, to keep the state external to the\npackage.</p>\n</li>\n<li>\n<p>Isolate the state in one or more CommonJS files that are shared between the\nCommonJS and ES module versions of the package. For example, if the CommonJS\nand ES module entry points are <code>index.cjs</code> and <code>index.mjs</code>, respectively:</p>\n<pre><code class=\"language-js\">// ./node_modules/pkg/index.cjs\nconst state = require('./state.cjs');\nmodule.exports.state = state;\n</code></pre>\n<pre><code class=\"language-js\">// ./node_modules/pkg/index.mjs\nimport state from './state.cjs';\nexport {\n  state\n};\n</code></pre>\n<p>Even if <code>pkg</code> is used via both <code>require</code> and <code>import</code> in an application (for\nexample, via <code>import</code> in application code and via <code>require</code> by a dependency)\neach reference of <code>pkg</code> will contain the same state; and modifying that\nstate from either module system will apply to both.</p>\n</li>\n</ol>\n<p>Any plugins that attach to the package’s singleton would need to separately\nattach to both the CommonJS and ES module singletons.</p>\n<p>This approach is appropriate for any of the following use cases:</p>\n<ul>\n<li>The package is currently written in ES module syntax and the package author\nwants that version to be used wherever such syntax is supported.</li>\n<li>The package is stateless or its state can be isolated without too much\ndifficulty.</li>\n<li>The package is unlikely to have other public packages that depend on it, or if\nit does, the package is stateless or has state that need not be shared between\ndependencies or with the overall application.</li>\n</ul>\n<p>Even with isolated state, there is still the cost of possible extra code\nexecution between the CommonJS and ES module versions of a package.</p>\n<p>As with the previous approach, a variant of this approach not requiring\nconditional exports for consumers could be to add an export, e.g.\n<code>\"./module\"</code>, to point to an all-ES module-syntax version of the package:</p>\n<!-- eslint-skip -->\n<pre><code class=\"language-js\">// ./node_modules/pkg/package.json\n{\n  \"type\": \"module\",\n  \"main\": \"./index.cjs\",\n  \"exports\": {\n    \".\": \"./index.cjs\",\n    \"./module\": \"./index.mjs\"\n  }\n}\n</code></pre>",
                      "type": "module",
                      "displayName": "Approach #2: Isolate state"
                    }
                  ],
                  "type": "module",
                  "displayName": "Writing dual packages while avoiding or minimizing hazards"
                }
              ],
              "type": "module",
              "displayName": "Dual CommonJS/ES module packages"
            }
          ],
          "type": "misc",
          "displayName": "Packages"
        },
        {
          "textRaw": "`import` Specifiers",
          "name": "`import`_specifiers",
          "modules": [
            {
              "textRaw": "Terminology",
              "name": "terminology",
              "desc": "<p>The <em>specifier</em> of an <code>import</code> statement is the string after the <code>from</code> keyword,\ne.g. <code>'path'</code> in <code>import { sep } from 'path'</code>. Specifiers are also used in\n<code>export from</code> statements, and as the argument to an <code>import()</code> expression.</p>\n<p>There are four types of specifiers:</p>\n<ul>\n<li>\n<p><em>Bare specifiers</em> like <code>'some-package'</code>. They refer to an entry point of a\npackage by the package name.</p>\n</li>\n<li>\n<p><em>Deep import specifiers</em> like <code>'some-package/lib/shuffle.mjs'</code>. They refer to\na path within a package prefixed by the package name.</p>\n</li>\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.</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 specifiers, and the bare specifier portion of deep import specifiers, are\nstrings; but everything else in a specifier is a URL.</p>\n<p>Only <code>file:</code> and <code>data:</code> URLs are supported. A specifier like\n<code>'https://example.com/app.js'</code> may be supported by browsers but it is not\nsupported in Node.js.</p>\n<p>Specifiers may not begin with <code>/</code> or <code>//</code>. These are reserved for potential\nfuture use. The root of the current volume may be referenced via <code>file:///</code>.</p>",
              "modules": [
                {
                  "textRaw": "`data:` Imports",
                  "name": "`data:`_imports",
                  "meta": {
                    "added": [
                      "v12.10.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p><a href=\"https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs\"><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<p><code>data:</code> URLs only resolve <a href=\"esm.html#esm_terminology\"><em>Bare specifiers</em></a> for builtin modules\nand <a href=\"esm.html#esm_terminology\"><em>Absolute specifiers</em></a>. Resolving\n<a href=\"esm.html#esm_terminology\"><em>Relative specifiers</em></a> will 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> will fail to resolve since there\nis no concept of relative resolution for <code>data:</code> URLs. An example of a <code>data:</code>\nURLs being used is:</p>\n<pre><code class=\"language-js\">import 'data:text/javascript,console.log(\"hello!\");';\nimport _ from 'data:application/json,\"world!\"';\n</code></pre>",
                  "type": "module",
                  "displayName": "`data:` Imports"
                }
              ],
              "type": "module",
              "displayName": "Terminology"
            }
          ],
          "type": "misc",
          "displayName": "`import` Specifiers"
        },
        {
          "textRaw": "Differences between ES modules and CommonJS",
          "name": "differences_between_es_modules_and_commonjs",
          "modules": [
            {
              "textRaw": "Mandatory file extensions",
              "name": "mandatory_file_extensions",
              "desc": "<p>A file extension must be provided when using the <code>import</code> keyword. Directory\nindexes (e.g. <code>'./startup/index.js'</code>) must also be fully specified.</p>\n<p>This behavior matches how <code>import</code> behaves in browser environments, assuming a\ntypically configured server.</p>",
              "type": "module",
              "displayName": "Mandatory file extensions"
            },
            {
              "textRaw": "No `NODE_PATH`",
              "name": "no_`node_path`",
              "desc": "<p><code>NODE_PATH</code> is not part of resolving <code>import</code> specifiers. Please use symlinks\nif this behavior is desired.</p>",
              "type": "module",
              "displayName": "No `NODE_PATH`"
            },
            {
              "textRaw": "No `require`, `exports`, `module.exports`, `__filename`, `__dirname`",
              "name": "no_`require`,_`exports`,_`module.exports`,_`__filename`,_`__dirname`",
              "desc": "<p>These CommonJS variables are not available in ES modules.</p>\n<p><code>require</code> can be imported into an ES module using <a href=\"modules.html#modules_module_createrequire_filename\"><code>module.createRequire()</code></a>.</p>\n<p>Equivalents of <code>__filename</code> and <code>__dirname</code> can be created inside of each file\nvia <a href=\"esm.html#esm_import_meta\"><code>import.meta.url</code></a>.</p>\n<pre><code class=\"language-js\">import { fileURLToPath } from 'url';\nimport { dirname } from 'path';\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = dirname(__filename);\n</code></pre>",
              "type": "module",
              "displayName": "No `require`, `exports`, `module.exports`, `__filename`, `__dirname`"
            },
            {
              "textRaw": "No `require.resolve`",
              "name": "no_`require.resolve`",
              "desc": "<p>Former use cases relying on <code>require.resolve</code> to determine the resolved path\nof a module can be supported via <code>import.meta.resolve</code>, which is experimental\nand supported via the <code>--experimental-import-meta-resolve</code> flag:</p>\n<pre><code class=\"language-js\">(async () => {\n  const dependencyAsset = await import.meta.resolve('component-lib/asset.css');\n})();\n</code></pre>\n<p><code>import.meta.resolve</code> also accepts a second argument which is the parent module\nfrom which to resolve from:</p>\n<pre><code class=\"language-js\">(async () => {\n  // Equivalent to import.meta.resolve('./dep')\n  await import.meta.resolve('./dep', import.meta.url);\n})();\n</code></pre>\n<p>This function is asynchronous since the ES module resolver in Node.js is\nasynchronous. With the introduction of <a href=\"https://github.com/tc39/proposal-top-level-await\">Top-Level Await</a>, these use cases\nwill be easier as they won't require an async function wrapper.</p>",
              "type": "module",
              "displayName": "No `require.resolve`"
            },
            {
              "textRaw": "No `require.extensions`",
              "name": "no_`require.extensions`",
              "desc": "<p><code>require.extensions</code> is not used by <code>import</code>. The expectation is that loader\nhooks can provide this workflow in the future.</p>",
              "type": "module",
              "displayName": "No `require.extensions`"
            },
            {
              "textRaw": "No `require.cache`",
              "name": "no_`require.cache`",
              "desc": "<p><code>require.cache</code> is not used by <code>import</code>. It has a separate cache.</p>",
              "type": "module",
              "displayName": "No `require.cache`"
            },
            {
              "textRaw": "URL-based paths",
              "name": "url-based_paths",
              "desc": "<p>ES modules are resolved and cached based upon\n<a href=\"https://url.spec.whatwg.org/\">URL</a> semantics. This means that files containing\nspecial characters such as <code>#</code> and <code>?</code> need to be escaped.</p>\n<p>Modules will be loaded multiple times if the <code>import</code> specifier used to resolve\nthem have 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>For now, only modules using the <code>file:</code> protocol can be loaded.</p>",
              "type": "module",
              "displayName": "URL-based paths"
            }
          ],
          "type": "misc",
          "displayName": "Differences between ES modules and CommonJS"
        },
        {
          "textRaw": "Interoperability with CommonJS",
          "name": "interoperability_with_commonjs",
          "modules": [
            {
              "textRaw": "`require`",
              "name": "`require`",
              "desc": "<p><code>require</code> always treats the files it references as CommonJS. This applies\nwhether <code>require</code> is used the traditional way within a CommonJS environment, or\nin an ES module environment using <a href=\"modules.html#modules_module_createrequire_filename\"><code>module.createRequire()</code></a>.</p>\n<p>To include an ES module into CommonJS, use <a href=\"esm.html#esm_import_expressions\"><code>import()</code></a>.</p>",
              "type": "module",
              "displayName": "`require`"
            },
            {
              "textRaw": "`import` statements",
              "name": "`import`_statements",
              "desc": "<p>An <code>import</code> statement can reference an ES module or a CommonJS module. Other\nfile types such as JSON or native modules are not supported. For those, use\n<a href=\"modules.html#modules_module_createrequire_filename\"><code>module.createRequire()</code></a>.</p>\n<p><code>import</code> statements are permitted only in ES modules. For similar functionality\nin CommonJS, see <a href=\"esm.html#esm_import_expressions\"><code>import()</code></a>.</p>\n<p>The <em>specifier</em> of an <code>import</code> statement (the string after the <code>from</code> keyword)\ncan either be an URL-style relative path like <code>'./file.mjs'</code> or a package name\nlike <code>'fs'</code>.</p>\n<p>Like in CommonJS, files within packages can be accessed by appending a path to\nthe package name; unless the package’s <code>package.json</code> contains an <code>\"exports\"</code>\nfield, in which case files within packages need to be accessed via the path\ndefined in <code>\"exports\"</code>.</p>\n<pre><code class=\"language-js\">import { sin, cos } from 'geometry/trigonometry-functions.mjs';\n</code></pre>\n<p>Only the “default export” is supported for CommonJS files or packages:</p>\n<!-- eslint-disable no-duplicate-imports -->\n<pre><code class=\"language-js\">import packageMain from 'commonjs-package'; // Works\n\nimport { method } from 'commonjs-package'; // Errors\n</code></pre>\n<p>It is also possible to\n<a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import#Import_a_module_for_its_side_effects_only\">import an ES or CommonJS module for its side effects only</a>.</p>",
              "type": "module",
              "displayName": "`import` statements"
            },
            {
              "textRaw": "`import()` expressions",
              "name": "`import()`_expressions",
              "desc": "<p><a href=\"https://wiki.developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import#Dynamic_Imports\">Dynamic <code>import()</code></a> is supported in both CommonJS and ES modules. It can be\nused to include ES module files from CommonJS code.</p>",
              "type": "module",
              "displayName": "`import()` expressions"
            }
          ],
          "type": "misc",
          "displayName": "Interoperability with CommonJS"
        },
        {
          "textRaw": "CommonJS, JSON, and native modules",
          "name": "commonjs,_json,_and_native_modules",
          "desc": "<p>CommonJS, JSON, and native modules can be used with\n<a href=\"modules.html#modules_module_createrequire_filename\"><code>module.createRequire()</code></a>.</p>\n<pre><code class=\"language-js\">// cjs.cjs\nmodule.exports = 'cjs';\n\n// esm.mjs\nimport { createRequire } from 'module';\n\nconst require = createRequire(import.meta.url);\n\nconst cjs = require('./cjs.cjs');\ncjs === 'cjs'; // true\n</code></pre>",
          "type": "misc",
          "displayName": "CommonJS, JSON, and native modules"
        },
        {
          "textRaw": "Builtin modules",
          "name": "builtin_modules",
          "desc": "<p>Builtin modules will 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 builtin modules are updated only by calling\n<a href=\"modules.html#modules_module_syncbuiltinesmexports\"><code>module.syncBuiltinESMExports()</code></a>.</p>\n<pre><code class=\"language-js\">import EventEmitter from 'events';\nconst e = new EventEmitter();\n</code></pre>\n<pre><code class=\"language-js\">import { readFile } from '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 'fs';\nimport { syncBuiltinESMExports } from 'module';\n\nfs.readFileSync = () => Buffer.from('Hello, ESM');\nsyncBuiltinESMExports();\n\nfs.readFileSync === readFileSync;\n</code></pre>",
          "type": "misc",
          "displayName": "Builtin modules"
        },
        {
          "textRaw": "Experimental JSON modules",
          "name": "experimental_json_modules",
          "desc": "<p>Currently importing JSON modules are only supported in the <code>commonjs</code> mode\nand are loaded using the CJS loader. <a href=\"https://html.spec.whatwg.org/#creating-a-json-module-script\">WHATWG JSON modules specification</a> are\nstill being standardized, and are experimentally supported by including the\nadditional flag <code>--experimental-json-modules</code> when running Node.js.</p>\n<p>When the <code>--experimental-json-modules</code> flag is included both the\n<code>commonjs</code> and <code>module</code> mode will use the new experimental JSON\nloader. The imported JSON only exposes a <code>default</code>, there is no\nsupport for named exports. A cache entry is created in the CommonJS\ncache, to avoid duplication. The same object will be returned in\nCommonJS if the JSON module has already been imported from the\nsame path.</p>\n<p>Assuming an <code>index.mjs</code> with</p>\n<!-- eslint-skip -->\n<pre><code class=\"language-js\">import packageConfig from './package.json';\n</code></pre>\n<p>The <code>--experimental-json-modules</code> flag is needed for the module\nto work.</p>\n<pre><code class=\"language-bash\">node index.mjs # fails\nnode --experimental-json-modules index.mjs # works\n</code></pre>",
          "type": "misc",
          "displayName": "Experimental JSON modules"
        },
        {
          "textRaw": "Experimental Wasm modules",
          "name": "experimental_wasm_modules",
          "desc": "<p>Importing Web Assembly modules is supported under the\n<code>--experimental-wasm-modules</code> flag, allowing any <code>.wasm</code> files to be\nimported as normal modules while also supporting their module imports.</p>\n<p>This integration is in line with the\n<a href=\"https://github.com/webassembly/esm-integration\">ES Module Integration Proposal for Web Assembly</a>.</p>\n<p>For example, an <code>index.mjs</code> containing:</p>\n<pre><code class=\"language-js\">import * as M from './module.wasm';\nconsole.log(M);\n</code></pre>\n<p>executed under:</p>\n<pre><code class=\"language-bash\">node --experimental-wasm-modules index.mjs\n</code></pre>\n<p>would provide the exports interface for the instantiation of <code>module.wasm</code>.</p>",
          "type": "misc",
          "displayName": "Experimental Wasm modules"
        },
        {
          "textRaw": "Experimental loaders",
          "name": "Experimental loaders",
          "type": "misc",
          "desc": "<p><strong>Note: This API is currently being redesigned and will still change.</strong></p>\n<p>To customize the default module resolution, loader hooks can optionally be\nprovided via a <code>--experimental-loader ./loader-name.mjs</code> argument to Node.js.</p>\n<p>When hooks are used they only apply to ES module loading and not to any\nCommonJS modules loaded.</p>",
          "miscs": [
            {
              "textRaw": "Hooks",
              "name": "hooks",
              "modules": [
                {
                  "textRaw": "<code>resolve</code> hook",
                  "name": "<code>resolve</code>_hook",
                  "desc": "<blockquote>\n<p>Note: The loaders API is being redesigned. This hook may disappear or its\nsignature may change. Do not rely on the API described below.</p>\n</blockquote>\n<p>The <code>resolve</code> hook returns the resolved file URL for a given module specifier\nand parent URL. The module specifier is the string in an <code>import</code> statement or\n<code>import()</code> expression, and the parent URL is the URL of the module that imported\nthis one, or <code>undefined</code> if this is the main entry point for the application.</p>\n<p>The <code>conditions</code> property on the <code>context</code> is an array of conditions for\n<a href=\"esm.html#esm_conditional_exports\">Conditional exports</a> that apply to this resolution request. They can be used\nfor looking up conditional mappings elsewhere or to modify the list when calling\nthe default resolution logic.</p>\n<p>The <a href=\"esm.html#esm_conditional_exports\">current set of Node.js default conditions</a> will always\nbe in the <code>context.conditions</code> list passed to the hook. If the hook wants to\nensure Node.js-compatible resolution logic, all items from this default\ncondition list <strong>must</strong> be passed through to the <code>defaultResolve</code> function.</p>\n<pre><code class=\"language-js\">/**\n * @param {string} specifier\n * @param {{\n *   parentURL: !(string | undefined),\n *   conditions: !(Array&#x3C;string>),\n * }} context\n * @param {Function} defaultResolve\n * @returns {!(Promise&#x3C;{ url: string }>)}\n */\nexport async function resolve(specifier, context, defaultResolve) {\n  const { parentURL = null } = context;\n  if (Math.random() > 0.5) { // Some condition.\n    // For some or all specifiers, do some custom logic for resolving.\n    // Always return an object of the form {url: &#x3C;string>}.\n    return {\n      url: parentURL ?\n        new URL(specifier, parentURL).href :\n        new URL(specifier).href,\n    };\n  }\n  if (Math.random() &#x3C; 0.5) { // Another condition.\n    // When calling `defaultResolve`, the arguments can be modified. In this\n    // case it's adding another value for matching conditional exports.\n    return defaultResolve(specifier, {\n      ...context,\n      conditions: [...context.conditions, 'another-condition'],\n    });\n  }\n  // Defer to Node.js for all other specifiers.\n  return defaultResolve(specifier, context, defaultResolve);\n}\n</code></pre>",
                  "type": "module",
                  "displayName": "<code>resolve</code> hook"
                },
                {
                  "textRaw": "<code>getFormat</code> hook",
                  "name": "<code>getformat</code>_hook",
                  "desc": "<blockquote>\n<p>Note: The loaders API is being redesigned. This hook may disappear or its\nsignature may change. Do not rely on the API described below.</p>\n</blockquote>\n<p>The <code>getFormat</code> hook provides a way to define a custom method of determining how\na URL should be interpreted. The <code>format</code> returned also affects what the\nacceptable forms of source values are for a module when parsing. This can be one\nof 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>getSource</code> or <code>transformSource</code></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>'builtin'</code></td>\n<td>Load a Node.js builtin module</td>\n<td>Not applicable</td>\n</tr>\n<tr>\n<td><code>'commonjs'</code></td>\n<td>Load a Node.js CommonJS module</td>\n<td>Not applicable</td>\n</tr>\n<tr>\n<td><code>'dynamic'</code></td>\n<td>Use a <a href=\"esm.html#esm_code_dynamicinstantiate_code_hook\">dynamic instantiate hook</a></td>\n<td>Not applicable</td>\n</tr>\n<tr>\n<td><code>'json'</code></td>\n<td>Load a JSON file</td>\n<td>{ <a href=\"http://www.ecma-international.org/ecma-262/6.0/#sec-arraybuffer-constructor\">ArrayBuffer</a>, <a href=\"http://www.ecma-international.org/ecma-262/6.0/#sec-string-constructor\">string</a>, <a href=\"http://www.ecma-international.org/ecma-262/6.0/#sec-typedarray-objects\">TypedArray</a> }</td>\n</tr>\n<tr>\n<td><code>'module'</code></td>\n<td>Load an ES module</td>\n<td>{ <a href=\"http://www.ecma-international.org/ecma-262/6.0/#sec-arraybuffer-constructor\">ArrayBuffer</a>, <a href=\"http://www.ecma-international.org/ecma-262/6.0/#sec-string-constructor\">string</a>, <a href=\"http://www.ecma-international.org/ecma-262/6.0/#sec-typedarray-objects\">TypedArray</a> }</td>\n</tr>\n<tr>\n<td><code>'wasm'</code></td>\n<td>Load a WebAssembly module</td>\n<td>{ <a href=\"http://www.ecma-international.org/ecma-262/6.0/#sec-arraybuffer-constructor\">ArrayBuffer</a>, <a href=\"http://www.ecma-international.org/ecma-262/6.0/#sec-string-constructor\">string</a>, <a href=\"http://www.ecma-international.org/ecma-262/6.0/#sec-typedarray-objects\">TypedArray</a> }</td>\n</tr>\n</tbody>\n</table>\n<p>Note: These types all correspond to classes defined in ECMAScript.</p>\n<ul>\n<li>The specific <a href=\"http://www.ecma-international.org/ecma-262/6.0/#sec-arraybuffer-constructor\">ArrayBuffer</a> object is a <a href=\"https://tc39.es/ecma262/#sec-sharedarraybuffer-constructor\">SharedArrayBuffer</a>.</li>\n<li>The specific <a href=\"http://www.ecma-international.org/ecma-262/6.0/#sec-string-constructor\">string</a> object is not the class constructor, but an instance.</li>\n<li>The specific <a href=\"http://www.ecma-international.org/ecma-262/6.0/#sec-typedarray-objects\">TypedArray</a> object is a <a href=\"http://www.ecma-international.org/ecma-262/6.0/#sec-uint8array\">Uint8Array</a>.</li>\n</ul>\n<p>Note: If the source value of a text-based format (i.e., <code>'json'</code>, <code>'module'</code>) is\nnot a string, it will be converted to a string using <a href=\"util.html#util_class_util_textdecoder\"><code>util.TextDecoder</code></a>.</p>\n<pre><code class=\"language-js\">/**\n * @param {string} url\n * @param {Object} context (currently empty)\n * @param {Function} defaultGetFormat\n * @returns {Promise&#x3C;{ format: string }>}\n */\nexport async function getFormat(url, context, defaultGetFormat) {\n  if (Math.random() > 0.5) { // Some condition.\n    // For some or all URLs, do some custom logic for determining format.\n    // Always return an object of the form {format: &#x3C;string>}, where the\n    // format is one of the strings in the table above.\n    return {\n      format: 'module',\n    };\n  }\n  // Defer to Node.js for all other URLs.\n  return defaultGetFormat(url, context, defaultGetFormat);\n}\n</code></pre>",
                  "type": "module",
                  "displayName": "<code>getFormat</code> hook"
                },
                {
                  "textRaw": "<code>getSource</code> hook",
                  "name": "<code>getsource</code>_hook",
                  "desc": "<blockquote>\n<p>Note: The loaders API is being redesigned. This hook may disappear or its\nsignature may change. Do not rely on the API described below.</p>\n</blockquote>\n<p>The <code>getSource</code> hook provides a way to define a custom method for retrieving\nthe source code of an ES module specifier. This would allow a loader to\npotentially avoid reading files from disk.</p>\n<pre><code class=\"language-js\">/**\n * @param {string} url\n * @param {{ format: string }} context\n * @param {Function} defaultGetSource\n * @returns {Promise&#x3C;{ source: !(SharedArrayBuffer | string | Uint8Array) }>}\n */\nexport async function getSource(url, context, defaultGetSource) {\n  const { format } = context;\n  if (Math.random() > 0.5) { // Some condition.\n    // For some or all URLs, do some custom logic for retrieving the source.\n    // Always return an object of the form {source: &#x3C;string|buffer>}.\n    return {\n      source: '...',\n    };\n  }\n  // Defer to Node.js for all other URLs.\n  return defaultGetSource(url, context, defaultGetSource);\n}\n</code></pre>",
                  "type": "module",
                  "displayName": "<code>getSource</code> hook"
                },
                {
                  "textRaw": "<code>transformSource</code> hook",
                  "name": "<code>transformsource</code>_hook",
                  "desc": "<pre><code class=\"language-console\">NODE_OPTIONS='--experimental-loader ./custom-loader.mjs' node x.js\n</code></pre>\n<blockquote>\n<p>Note: The loaders API is being redesigned. This hook may disappear or its\nsignature may change. Do not rely on the API described below.</p>\n</blockquote>\n<p>The <code>transformSource</code> hook provides a way to modify the source code of a loaded\nES module file after the source string has been loaded but before Node.js has\ndone anything with it.</p>\n<p>If this hook is used to convert unknown-to-Node.js file types into executable\nJavaScript, a resolve hook is also necessary in order to register any\nunknown-to-Node.js file extensions. See the <a href=\"esm.html#esm_transpiler_loader\">transpiler loader example</a> below.</p>\n<pre><code class=\"language-js\">/**\n * @param {!(SharedArrayBuffer | string | Uint8Array)} source\n * @param {{\n *   url: string,\n *   format: string,\n * }} context\n * @param {Function} defaultTransformSource\n * @returns {Promise&#x3C;{ source: !(SharedArrayBuffer | string | Uint8Array) }>}\n */\nexport async function transformSource(source, context, defaultTransformSource) {\n  const { url, format } = context;\n  if (Math.random() > 0.5) { // Some condition.\n    // For some or all URLs, do some custom logic for modifying the source.\n    // Always return an object of the form {source: &#x3C;string|buffer>}.\n    return {\n      source: '...',\n    };\n  }\n  // Defer to Node.js for all other sources.\n  return defaultTransformSource(source, context, defaultTransformSource);\n}\n</code></pre>",
                  "type": "module",
                  "displayName": "<code>transformSource</code> hook"
                },
                {
                  "textRaw": "<code>getGlobalPreloadCode</code> hook",
                  "name": "<code>getglobalpreloadcode</code>_hook",
                  "desc": "<blockquote>\n<p>Note: The loaders API is being redesigned. This hook may disappear or its\nsignature may change. Do not rely on the API described below.</p>\n</blockquote>\n<p>Sometimes it can be necessary to run some code inside of the same global scope\nthat the application will run in. This hook allows to return a string that will\nbe ran as sloppy-mode script on startup.</p>\n<p>Similar to how CommonJS wrappers work, the code runs in an implicit function\nscope. The only argument is a <code>require</code>-like function that can be used to load\nbuiltins like \"fs\": <code>getBuiltin(request: string)</code>.</p>\n<p>If the code needs more advanced <code>require</code> features, it will have to construct\nits own <code>require</code> using  <code>module.createRequire()</code>.</p>\n<pre><code class=\"language-js\">/**\n * @returns {string} Code to run before application startup\n */\nexport function getGlobalPreloadCode() {\n  return `\\\nglobalThis.someInjectedProperty = 42;\nconsole.log('I just set some globals!');\n\nconst { createRequire } = getBuiltin('module');\n\nconst require = createRequire(process.cwd() + '/&#x3C;preload>');\n// [...]\n`;\n}\n</code></pre>",
                  "type": "module",
                  "displayName": "<code>getGlobalPreloadCode</code> hook"
                },
                {
                  "textRaw": "<code>dynamicInstantiate</code> hook",
                  "name": "<code>dynamicinstantiate</code>_hook",
                  "desc": "<blockquote>\n<p>Note: The loaders API is being redesigned. This hook may disappear or its\nsignature may change. Do not rely on the API described below.</p>\n</blockquote>\n<p>To create a custom dynamic module that doesn't correspond to one of the\nexisting <code>format</code> interpretations, the <code>dynamicInstantiate</code> hook can be used.\nThis hook is called only for modules that return <code>format: 'dynamic'</code> from\nthe <a href=\"esm.html#esm_code_getformat_code_hook\"><code>getFormat</code> hook</a>.</p>\n<pre><code class=\"language-js\">/**\n * @param {string} url\n * @returns {object} response\n * @returns {array} response.exports\n * @returns {function} response.execute\n */\nexport async function dynamicInstantiate(url) {\n  return {\n    exports: ['customExportName'],\n    execute: (exports) => {\n      // Get and set functions provided for pre-allocated export names\n      exports.customExportName.set('value');\n    }\n  };\n}\n</code></pre>\n<p>With the list of module exports provided upfront, the <code>execute</code> function will\nthen be called at the exact point of module evaluation order for that module\nin the import tree.</p>\n<h3>Examples</h3>\n<p>The various loader hooks can be used together to accomplish wide-ranging\ncustomizations of Node.js’ code loading and evaluation behaviors.</p>",
                  "type": "module",
                  "displayName": "<code>dynamicInstantiate</code> hook"
                },
                {
                  "textRaw": "HTTPS loader",
                  "name": "https_loader",
                  "desc": "<p>In current Node.js, specifiers starting with <code>https://</code> are unsupported. The\nloader below registers hooks to enable rudimentary support for such specifiers.\nWhile this may seem like a significant improvement to Node.js core\nfunctionality, there are substantial downsides to actually using this loader:\nperformance is much slower than loading files from disk, there is no caching,\nand there is no security.</p>\n<pre><code class=\"language-js\">// https-loader.mjs\nimport { get } from 'https';\n\nexport function resolve(specifier, context, defaultResolve) {\n  const { parentURL = null } = context;\n\n  // Normally Node.js would error on specifiers starting with 'https://', so\n  // this hook intercepts them and converts them into absolute URLs to be\n  // passed along to the later hooks below.\n  if (specifier.startsWith('https://')) {\n    return {\n      url: specifier\n    };\n  } else if (parentURL &#x26;&#x26; parentURL.startsWith('https://')) {\n    return {\n      url: new URL(specifier, parentURL).href\n    };\n  }\n\n  // Let Node.js handle all other specifiers.\n  return defaultResolve(specifier, context, defaultResolve);\n}\n\nexport function getFormat(url, context, defaultGetFormat) {\n  // This loader assumes all network-provided JavaScript is ES module code.\n  if (url.startsWith('https://')) {\n    return {\n      format: 'module'\n    };\n  }\n\n  // Let Node.js handle all other URLs.\n  return defaultGetFormat(url, context, defaultGetFormat);\n}\n\nexport function getSource(url, context, defaultGetSource) {\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.on('data', (chunk) => data += chunk);\n        res.on('end', () => resolve({ source: data }));\n      }).on('error', (err) => reject(err));\n    });\n  }\n\n  // Let Node.js handle all other URLs.\n  return defaultGetSource(url, context, defaultGetSource);\n}\n</code></pre>\n<pre><code class=\"language-js\">// main.mjs\nimport { VERSION } from 'https://coffeescript.org/browser-compiler-modern/coffeescript.js';\n\nconsole.log(VERSION);\n</code></pre>\n<p>With this loader, running:</p>\n<pre><code class=\"language-console\">node --experimental-loader ./https-loader.mjs ./main.js\n</code></pre>\n<p>Will print the current version of CoffeeScript per the module at the URL in\n<code>main.mjs</code>.</p>",
                  "type": "module",
                  "displayName": "HTTPS loader"
                },
                {
                  "textRaw": "Transpiler loader",
                  "name": "transpiler_loader",
                  "desc": "<p>Sources that are in formats Node.js doesn’t understand can be converted into\nJavaScript using the <a href=\"esm.html#esm_code_transformsource_code_hook\"><code>transformSource</code> hook</a>. Before that hook gets called,\nhowever, other hooks need to tell Node.js not to throw an error on unknown file\ntypes; and to tell Node.js how to load this new file type.</p>\n<p>This is less performant than transpiling source files before running\nNode.js; a transpiler loader should only be used for development and testing\npurposes.</p>\n<pre><code class=\"language-js\">// coffeescript-loader.mjs\nimport { URL, pathToFileURL } from 'url';\nimport CoffeeScript from 'coffeescript';\n\nconst baseURL = pathToFileURL(`${process.cwd()}/`).href;\n\n// CoffeeScript files end in .coffee, .litcoffee or .coffee.md.\nconst extensionsRegex = /\\.coffee$|\\.litcoffee$|\\.coffee\\.md$/;\n\nexport function resolve(specifier, context, defaultResolve) {\n  const { parentURL = baseURL } = context;\n\n  // Node.js normally errors on unknown file extensions, so return a URL for\n  // specifiers ending in the CoffeeScript file extensions.\n  if (extensionsRegex.test(specifier)) {\n    return {\n      url: new URL(specifier, parentURL).href\n    };\n  }\n\n  // Let Node.js handle all other specifiers.\n  return defaultResolve(specifier, context, defaultResolve);\n}\n\nexport function getFormat(url, context, defaultGetFormat) {\n  // Now that we patched resolve to let CoffeeScript URLs through, we need to\n  // tell Node.js what format such URLs should be interpreted as. For the\n  // purposes of this loader, all CoffeeScript URLs are ES modules.\n  if (extensionsRegex.test(url)) {\n    return {\n      format: 'module'\n    };\n  }\n\n  // Let Node.js handle all other URLs.\n  return defaultGetFormat(url, context, defaultGetFormat);\n}\n\nexport function transformSource(source, context, defaultTransformSource) {\n  const { url, format } = context;\n\n  if (extensionsRegex.test(url)) {\n    return {\n      source: CoffeeScript.compile(source, { bare: true })\n    };\n  }\n\n  // Let Node.js handle all other sources.\n  return defaultTransformSource(source, context, defaultTransformSource);\n}\n</code></pre>\n<pre><code class=\"language-coffee\"># main.coffee\nimport { scream } from './scream.coffee'\nconsole.log scream 'hello, world'\n\nimport { version } from '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>With this loader, running:</p>\n<pre><code class=\"language-console\">node --experimental-loader ./coffeescript-loader.mjs main.coffee\n</code></pre>\n<p>Will cause <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>",
                  "type": "module",
                  "displayName": "Transpiler loader"
                }
              ],
              "type": "misc",
              "displayName": "Hooks"
            }
          ]
        },
        {
          "textRaw": "Resolution algorithm",
          "name": "resolution_algorithm",
          "modules": [
            {
              "textRaw": "Features",
              "name": "features",
              "desc": "<p>The resolver has the following properties:</p>\n<ul>\n<li>FileURL-based resolution as is used by ES modules</li>\n<li>Support for builtin module loading</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</ul>",
              "type": "module",
              "displayName": "Features"
            },
            {
              "textRaw": "Resolver algorithm",
              "name": "resolver_algorithm",
              "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 algorithm to determine the module format of a resolved URL is\nprovided by <strong>ESM_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>defaultEnv</em> is the conditional environment name priority 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 define a target module within the\npackage 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>Module Not Found</em>: The package or module requested does not exist.</li>\n</ul>\n<details>\n<summary>Resolver algorithm specification</summary>\n<p><strong>ESM_RESOLVE</strong>(<em>specifier</em>, <em>parentURL</em>)</p>\n<blockquote>\n<ol>\n<li>Let <em>resolvedURL</em> be <strong>undefined</strong>.</li>\n<li>\n<p>If <em>specifier</em> is a valid URL, then</p>\n<ol>\n<li>Set <em>resolvedURL</em> to the result of parsing and reserializing\n<em>specifier</em> as a URL.</li>\n</ol>\n</li>\n<li>\n<p>Otherwise, if <em>specifier</em> starts with <em>\"/\"</em>, then</p>\n<ol>\n<li>Throw an <em>Invalid Module Specifier</em> error.</li>\n</ol>\n</li>\n<li>\n<p>Otherwise, if <em>specifier</em> starts with <em>\"./\"</em> or <em>\"../\"</em>, then</p>\n<ol>\n<li>Set <em>resolvedURL</em> to the URL resolution of <em>specifier</em> relative to\n<em>parentURL</em>.</li>\n</ol>\n</li>\n<li>\n<p>Otherwise,</p>\n<ol>\n<li>Note: <em>specifier</em> is now a bare specifier.</li>\n<li>Set <em>resolvedURL</em> the result of\n<strong>PACKAGE_RESOLVE</strong>(<em>specifier</em>, <em>parentURL</em>).</li>\n</ol>\n</li>\n<li>\n<p>If <em>resolvedURL</em> contains any percent encodings of <em>\"/\"</em> or <em>\"\\\"</em> (<em>\"%2f\"</em>\nand <em>\"%5C\"</em> respectively), then</p>\n<ol>\n<li>Throw an <em>Invalid Module Specifier</em> error.</li>\n</ol>\n</li>\n<li>\n<p>If the file at <em>resolvedURL</em> is a directory, then</p>\n<ol>\n<li>Throw an <em>Unsupported Directory Import</em> error.</li>\n</ol>\n</li>\n<li>\n<p>If the file at <em>resolvedURL</em> does not exist, then</p>\n<ol>\n<li>Throw a <em>Module Not Found</em> error.</li>\n</ol>\n</li>\n<li>Set <em>resolvedURL</em> to the real path of <em>resolvedURL</em>.</li>\n<li>Let <em>format</em> be the result of <strong>ESM_FORMAT</strong>(<em>resolvedURL</em>).</li>\n<li>Load <em>resolvedURL</em> as module format, <em>format</em>.</li>\n<li>Return <em>resolvedURL</em>.</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 <em>undefined</em>.</li>\n<li>Let <em>packageSubpath</em> be <em>undefined</em>.</li>\n<li>\n<p>If <em>packageSpecifier</em> is an empty string, then</p>\n<ol>\n<li>Throw an <em>Invalid Module Specifier</em> error.</li>\n</ol>\n</li>\n<li>\n<p>Otherwise,</p>\n<ol>\n<li>\n<p>If <em>packageSpecifier</em> does not contain a <em>\"/\"</em> separator, then</p>\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>\n<p>If <em>packageName</em> starts with <em>\".\"</em> or contains <em>\"\\\"</em> or <em>\"%\"</em>, then</p>\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>undefined</em>.</li>\n<li>\n<p>If the length of <em>packageSpecifier</em> is greater than the length of\n<em>packageName</em>, then</p>\n<ol>\n<li>Set <em>packageSubpath</em> to <em>\".\"</em> concatenated with the substring of\n<em>packageSpecifier</em> from the position at the length of <em>packageName</em>.</li>\n</ol>\n</li>\n<li>\n<p>If <em>packageSubpath</em> contains any <em>\".\"</em> or <em>\"..\"</em> segments or percent\nencoded strings for <em>\"/\"</em> or <em>\"\\\"</em>, then</p>\n<ol>\n<li>Throw an <em>Invalid Module Specifier</em> error.</li>\n</ol>\n</li>\n<li>Set <em>selfUrl</em> to the result of\n<strong>SELF_REFERENCE_RESOLVE</strong>(<em>packageName</em>, <em>packageSubpath</em>, <em>parentURL</em>).</li>\n<li>If <em>selfUrl</em> isn't empty, return <em>selfUrl</em>.</li>\n<li>\n<p>If <em>packageSubpath</em> is <em>undefined</em> and <em>packageName</em> is a Node.js builtin\nmodule, then</p>\n<ol>\n<li>Return the string <em>\"nodejs:\"</em> concatenated with <em>packageSpecifier</em>.</li>\n</ol>\n</li>\n<li>\n<p>While <em>parentURL</em> is not the file system root,</p>\n<ol>\n<li>Let <em>packageURL</em> be the URL resolution of <em>\"node_modules/\"</em>\nconcatenated with <em>packageSpecifier</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>\n<p>If the folder at <em>packageURL</em> does not exist, then</p>\n<ol>\n<li>Set <em>parentURL</em> to the parent URL path of <em>parentURL</em>.</li>\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>\n<p>If <em>packageSubpath</em> is equal to <em>\"./\"</em>, then</p>\n<ol>\n<li>Return <em>packageURL</em> + <em>\"/\"</em>.</li>\n</ol>\n</li>\n<li>\n<p>If <em>packageSubpath</em> is _undefined__, then</p>\n<ol>\n<li>Return the result of <strong>PACKAGE_MAIN_RESOLVE</strong>(<em>packageURL</em>,\n<em>pjson</em>).</li>\n</ol>\n</li>\n<li>\n<p>Otherwise,</p>\n<ol>\n<li>\n<p>If <em>pjson</em> is not <strong>null</strong> and <em>pjson</em> has an <em>\"exports\"</em> key, then</p>\n<ol>\n<li>Let <em>exports</em> be <em>pjson.exports</em>.</li>\n<li>\n<p>If <em>exports</em> is not <strong>null</strong> or <strong>undefined</strong>, then</p>\n<ol>\n<li>Return <strong>PACKAGE_EXPORTS_RESOLVE</strong>(<em>packageURL</em>,\n<em>packageSubpath</em>, <em>pjson.exports</em>).</li>\n</ol>\n</li>\n</ol>\n</li>\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>SELF_REFERENCE_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>READ_PACKAGE_SCOPE</strong>(<em>parentURL</em>).</li>\n<li>\n<p>If <em>packageURL</em> is <strong>null</strong>, then</p>\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>\n<p>If <em>pjson</em> does not include an <em>\"exports\"</em> property, then</p>\n<ol>\n<li>Return <strong>undefined</strong>.</li>\n</ol>\n</li>\n<li>\n<p>If <em>pjson.name</em> is equal to <em>packageName</em>, then</p>\n<ol>\n<li>\n<p>If <em>packageSubpath</em> is equal to <em>\"./\"</em>, then</p>\n<ol>\n<li>Return <em>packageURL</em> + <em>\"/\"</em>.</li>\n</ol>\n</li>\n<li>\n<p>If <em>packageSubpath</em> is <em>undefined</em>, then</p>\n<ol>\n<li>Return the result of <strong>PACKAGE_MAIN_RESOLVE</strong>(<em>packageURL</em>, <em>pjson</em>).</li>\n</ol>\n</li>\n<li>\n<p>Otherwise,</p>\n<ol>\n<li>\n<p>If <em>pjson</em> is not <strong>null</strong> and <em>pjson</em> has an <em>\"exports\"</em> key, then</p>\n<ol>\n<li>Let <em>exports</em> be <em>pjson.exports</em>.</li>\n<li>\n<p>If <em>exports</em> is not <strong>null</strong> or <strong>undefined</strong>, then</p>\n<ol>\n<li>Return <strong>PACKAGE_EXPORTS_RESOLVE</strong>(<em>packageURL</em>, <em>subpath</em>,\n<em>pjson.exports</em>).</li>\n</ol>\n</li>\n</ol>\n</li>\n<li>Return the URL resolution of <em>subpath</em> in <em>packageURL</em>.</li>\n</ol>\n</li>\n</ol>\n</li>\n<li>Otherwise, return <strong>undefined</strong>.</li>\n</ol>\n</blockquote>\n<p><strong>PACKAGE_MAIN_RESOLVE</strong>(<em>packageURL</em>, <em>pjson</em>)</p>\n<blockquote>\n<ol>\n<li>\n<p>If <em>pjson</em> is <strong>null</strong>, then</p>\n<ol>\n<li>Throw a <em>Module Not Found</em> error.</li>\n</ol>\n</li>\n<li>\n<p>If <em>pjson.exports</em> is not <strong>null</strong> or <strong>undefined</strong>, then</p>\n<ol>\n<li>If <em>exports</em> is an Object with both a key starting with <em>\".\"</em> and a key\nnot starting with <em>\".\"</em>, throw an <em>Invalid Package Configuration</em> error.</li>\n<li>\n<p>If <em>pjson.exports</em> is a String or Array, or an Object containing no\nkeys starting with <em>\".\"</em>, then</p>\n<ol>\n<li>Return <strong>PACKAGE_EXPORTS_TARGET_RESOLVE</strong>(<em>packageURL</em>,\n<em>pjson.exports</em>, <em>\"\"</em>).</li>\n</ol>\n</li>\n<li>\n<p>If <em>pjson.exports</em> is an Object containing a <em>\".\"</em> property, then</p>\n<ol>\n<li>Let <em>mainExport</em> be the <em>\".\"</em> property in <em>pjson.exports</em>.</li>\n<li>Return <strong>PACKAGE_EXPORTS_TARGET_RESOLVE</strong>(<em>packageURL</em>,\n<em>mainExport</em>, <em>\"\"</em>).</li>\n</ol>\n</li>\n<li>Throw a <em>Package Path Not Exported</em> error.</li>\n</ol>\n</li>\n<li>Let <em>legacyMainURL</em> be the result applying the legacy\n<strong>LOAD_AS_DIRECTORY</strong> CommonJS resolver to <em>packageURL</em>, throwing a\n<em>Module Not Found</em> error for no resolution.</li>\n<li>Return <em>legacyMainURL</em>.</li>\n</ol>\n</blockquote>\n<p><strong>PACKAGE_EXPORTS_RESOLVE</strong>(<em>packageURL</em>, <em>packagePath</em>, <em>exports</em>)</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>\n<p>If <em>exports</em> is an Object and all keys of <em>exports</em> start with <em>\".\"</em>, then</p>\n<ol>\n<li>Set <em>packagePath</em> to <em>\"./\"</em> concatenated with <em>packagePath</em>.</li>\n<li>\n<p>If <em>packagePath</em> is a key of <em>exports</em>, then</p>\n<ol>\n<li>Let <em>target</em> be the value of <em>exports[packagePath]</em>.</li>\n<li>Return <strong>PACKAGE_EXPORTS_TARGET_RESOLVE</strong>(<em>packageURL</em>, <em>target</em>,\n<em>\"\"</em>, <em>defaultEnv</em>).</li>\n</ol>\n</li>\n<li>Let <em>directoryKeys</em> be the list of keys of <em>exports</em> ending in\n<em>\"/\"</em>, sorted by length descending.</li>\n<li>\n<p>For each key <em>directory</em> in <em>directoryKeys</em>, do</p>\n<ol>\n<li>\n<p>If <em>packagePath</em> starts with <em>directory</em>, then</p>\n<ol>\n<li>Let <em>target</em> be the value of <em>exports[directory]</em>.</li>\n<li>Let <em>subpath</em> be the substring of <em>target</em> starting at the index\nof the length of <em>directory</em>.</li>\n<li>Return <strong>PACKAGE_EXPORTS_TARGET_RESOLVE</strong>(<em>packageURL</em>, <em>target</em>,\n<em>subpath</em>, <em>defaultEnv</em>).</li>\n</ol>\n</li>\n</ol>\n</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_EXPORTS_TARGET_RESOLVE</strong>(<em>packageURL</em>, <em>target</em>, <em>subpath</em>, <em>env</em>)</p>\n<blockquote>\n<ol>\n<li>\n<p>If <em>target</em> is a String, then</p>\n<ol>\n<li>If <em>target</em> does not start with <em>\"./\"</em> or contains any <em>\"node_modules\"</em>\nsegments including <em>\"node_modules\"</em> percent-encoding, throw an\n<em>Invalid Package 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>If <em>resolvedTarget</em> is not contained in <em>packageURL</em>, throw an\n<em>Invalid Package Target</em> error.</li>\n<li>If <em>subpath</em> has non-zero length and <em>target</em> does not end with <em>\"/\"</em>,\nthrow an <em>Invalid Module Specifier</em> error.</li>\n<li>Let <em>resolved</em> be the URL resolution of the concatenation of\n<em>subpath</em> and <em>resolvedTarget</em>.</li>\n<li>If <em>resolved</em> is not contained in <em>resolvedTarget</em>, throw an\n<em>Invalid Module Specifier</em> error.</li>\n<li>Return <em>resolved</em>.</li>\n</ol>\n</li>\n<li>\n<p>Otherwise, if <em>target</em> is a non-null Object, then</p>\n<ol>\n<li>If <em>exports</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>\n<p>For each property <em>p</em> of <em>target</em>, in object insertion order as,</p>\n<ol>\n<li>\n<p>If <em>p</em> equals <em>\"default\"</em> or <em>env</em> contains an entry for <em>p</em>, then</p>\n<ol>\n<li>Let <em>targetValue</em> be the value of the <em>p</em> property in <em>target</em>.</li>\n<li>Return the result of <strong>PACKAGE_EXPORTS_TARGET_RESOLVE</strong>(\n<em>packageURL</em>, <em>targetValue</em>, <em>subpath</em>, <em>env</em>), continuing the\nloop on any <em>Package Path Not Exported</em> error.</li>\n</ol>\n</li>\n</ol>\n</li>\n<li>Throw a <em>Package Path Not Exported</em> error.</li>\n</ol>\n</li>\n<li>\n<p>Otherwise, if <em>target</em> is an Array, then</p>\n<ol>\n<li>If <em>target.length is zero, throw a _Package Path Not Exported</em> error.</li>\n<li>\n<p>For each item <em>targetValue</em> in <em>target</em>, do</p>\n<ol>\n<li>If <em>targetValue</em> is an Array, continue the loop.</li>\n<li>Return the result of <strong>PACKAGE_EXPORTS_TARGET_RESOLVE</strong>(<em>packageURL</em>,\n<em>targetValue</em>, <em>subpath</em>, <em>env</em>), continuing the loop on any\n<em>Package Path Not Exported</em> or <em>Invalid Package Target</em> error.</li>\n</ol>\n</li>\n<li>Throw the last fallback resolution error.</li>\n</ol>\n</li>\n<li>Otherwise, if <em>target</em> is <em>null</em>, throw a <em>Package Path Not Exported</em>\nerror.</li>\n<li>Otherwise throw an <em>Invalid Package Target</em> error.</li>\n</ol>\n</blockquote>\n<p><strong>ESM_FORMAT</strong>(<em>url</em>)</p>\n<blockquote>\n<ol>\n<li>Assert: <em>url</em> corresponds to an existing file.</li>\n<li>Let <em>pjson</em> be the result of <strong>READ_PACKAGE_SCOPE</strong>(<em>url</em>).</li>\n<li>\n<p>If <em>url</em> ends in <em>\".mjs\"</em>, then</p>\n<ol>\n<li>Return <em>\"module\"</em>.</li>\n</ol>\n</li>\n<li>\n<p>If <em>url</em> ends in <em>\".cjs\"</em>, then</p>\n<ol>\n<li>Return <em>\"commonjs\"</em>.</li>\n</ol>\n</li>\n<li>\n<p>If <em>pjson?.type</em> exists and is <em>\"module\"</em>, then</p>\n<ol>\n<li>\n<p>If <em>url</em> ends in <em>\".js\"</em>, then</p>\n<ol>\n<li>Return <em>\"module\"</em>.</li>\n</ol>\n</li>\n<li>Throw an <em>Unsupported File Extension</em> error.</li>\n</ol>\n</li>\n<li>\n<p>Otherwise,</p>\n<ol>\n<li>Throw an <em>Unsupported File Extension</em> error.</li>\n</ol>\n</li>\n</ol>\n</blockquote>\n<p><strong>READ_PACKAGE_SCOPE</strong>(<em>url</em>)</p>\n<blockquote>\n<ol>\n<li>Let <em>scopeURL</em> be <em>url</em>.</li>\n<li>\n<p>While <em>scopeURL</em> is not the file system root,</p>\n<ol>\n<li>If <em>scopeURL</em> ends in a <em>\"node_modules\"</em> path segment, return <strong>null</strong>.</li>\n<li>Let <em>pjson</em> be the result of <strong>READ_PACKAGE_JSON</strong>(<em>scopeURL</em>).</li>\n<li>\n<p>If <em>pjson</em> is not <strong>null</strong>, then</p>\n<ol>\n<li>Return <em>pjson</em>.</li>\n</ol>\n</li>\n<li>Set <em>scopeURL</em> to the parent URL of <em>scopeURL</em>.</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>\n<p>If the file at <em>pjsonURL</em> does not exist, then</p>\n<ol>\n<li>Return <strong>null</strong>.</li>\n</ol>\n</li>\n<li>\n<p>If the file at <em>packageURL</em> does not parse as valid JSON, then</p>\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</details>",
              "type": "module",
              "displayName": "Resolver algorithm"
            },
            {
              "textRaw": "Customizing ESM specifier resolution algorithm",
              "name": "customizing_esm_specifier_resolution_algorithm",
              "desc": "<p>The current specifier resolution does not support all default behavior of\nthe CommonJS loader. One of the behavior differences is automatic resolution\nof file extensions and the ability to import directories that have an index\nfile.</p>\n<p>The <code>--experimental-specifier-resolution=[mode]</code> flag can be used to customize\nthe extension resolution algorithm. The default mode is <code>explicit</code>, which\nrequires the full path to a module be provided to the loader. To enable the\nautomatic extension resolution and importing from directories that include an\nindex file use the <code>node</code> mode.</p>\n<pre><code class=\"language-bash\">$ node index.mjs\nsuccess!\n$ node index # Failure!\nError: Cannot find module\n$ node --experimental-specifier-resolution=node index\nsuccess!\n</code></pre>",
              "type": "module",
              "displayName": "Customizing ESM specifier resolution algorithm"
            }
          ],
          "type": "misc",
          "displayName": "Resolution algorithm"
        }
      ],
      "properties": [
        {
          "textRaw": "`meta` {Object}",
          "type": "Object",
          "name": "meta",
          "desc": "<p>The <code>import.meta</code> metaproperty is an <code>Object</code> that contains the following\nproperty:</p>\n<ul>\n<li><code>url</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string&gt;</a> The absolute <code>file:</code> URL of the module.</li>\n</ul>"
        }
      ]
    },
    {
      "textRaw": "Errors",
      "name": "Errors",
      "introduced_in": "v4.0.0",
      "type": "misc",
      "desc": "<p>Applications running in Node.js will generally experience four categories of\nerrors:</p>\n<ul>\n<li>Standard JavaScript errors such as <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/EvalError\" class=\"type\">&lt;EvalError&gt;</a>, <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SyntaxError\" class=\"type\">&lt;SyntaxError&gt;</a>, <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RangeError\" class=\"type\">&lt;RangeError&gt;</a>,\n<a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ReferenceError\" class=\"type\">&lt;ReferenceError&gt;</a>, <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError\" class=\"type\">&lt;TypeError&gt;</a>, and <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/URIError\" class=\"type\">&lt;URIError&gt;</a>.</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>User-specified errors triggered by application code.</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>assert</code> module.</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/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error\" class=\"type\">&lt;Error&gt;</a> class and are guaranteed\nto provide <em>at least</em> the properties available on that class.</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 using <code>try…catch</code> or the Node.js process will exit\nimmediately.</p>\n<p>With few exceptions, <em>Synchronous</em> APIs (any blocking method that does not\naccept a <code>callback</code> function, such as <a href=\"fs.html#fs_fs_readfilesync_path_options\"><code>fs.readFileSync</code></a>), will use <code>throw</code>\nto report errors.</p>\n<p>Errors that occur within <em>Asynchronous APIs</em> may be reported in multiple ways:</p>\n<ul>\n<li>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.</li>\n</ul>\n<!-- eslint-disable no-useless-return -->\n<pre><code class=\"language-js\">const fs = require('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<ul>\n<li>\n<p>When an asynchronous method is called on an object that is an\n<a href=\"events.html#events_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('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#events_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#events_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: The <a href=\"domain.html\"><code>domain</code></a> module is\nused appropriately or a handler has been registered for the\n<a href=\"process.html#process_event_uncaughtexception\"><code>'uncaughtException'</code></a> event.</p>\n<pre><code class=\"language-js\">const EventEmitter = require('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>",
          "miscs": [
            {
              "textRaw": "Error-first callbacks",
              "name": "Error-first callbacks",
              "type": "misc",
              "desc": "<p>Most asynchronous methods exposed by the Node.js core API follow an idiomatic\npattern referred to as an <em>error-first callback</em>. With this pattern, a callback\nfunction is passed to the method as an argument. When the operation either\ncompletes or an error is raised, the callback function is called with the\n<code>Error</code> object (if any) passed as the first argument. If no error was raised,\nthe first argument will be passed as <code>null</code>.</p>\n<pre><code class=\"language-js\">const fs = require('fs');\n\nfunction errorFirstCallback(err, data) {\n  if (err) {\n    console.error('There was an error', err);\n    return;\n  }\n  console.log(data);\n}\n\nfs.readFile('/some/file/that/does-not-exist', errorFirstCallback);\nfs.readFile('/some/file/that/does-exist', errorFirstCallback);\n</code></pre>\n<p>The JavaScript <code>try…catch</code> mechanism <strong>cannot</strong> be used to intercept errors\ngenerated by asynchronous APIs. A common mistake for beginners is to try to\nuse <code>throw</code> inside an error-first callback:</p>\n<pre><code class=\"language-js\">// THIS WILL NOT WORK:\nconst fs = require('fs');\n\ntry {\n  fs.readFile('/some/file/that/does-not-exist', (err, data) => {\n    // Mistaken assumption: throwing here...\n    if (err) {\n      throw err;\n    }\n  });\n} catch (err) {\n  // This will not catch the throw!\n  console.error(err);\n}\n</code></pre>\n<p>This will not work because the callback function passed to <code>fs.readFile()</code> is\ncalled asynchronously. By the time the callback has been called, the\nsurrounding code, including the <code>try…catch</code> block, will have already exited.\nThrowing an error inside the callback <strong>can crash the Node.js process</strong> in most\ncases. If <a href=\"domain.html\">domains</a> are enabled, or a handler has been registered with\n<code>process.on('uncaughtException')</code>, such errors can be intercepted.</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",
          "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",
              "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",
              "desc": "<p>The OpenSSL function the error originates in.</p>"
            },
            {
              "textRaw": "`error.library`",
              "name": "library",
              "desc": "<p>The OpenSSL library the error originates in.</p>"
            },
            {
              "textRaw": "`error.reason`",
              "name": "reason",
              "desc": "<p>A human-readable string describing the reason for the error.</p>\n<p><a id=\"nodejs-error-codes\"></a></p>"
            }
          ],
          "type": "misc",
          "displayName": "OpenSSL errors"
        },
        {
          "textRaw": "Node.js error codes",
          "name": "node.js_error_codes",
          "desc": "<p><a id=\"ERR_AMBIGUOUS_ARGUMENT\"></a></p>",
          "modules": [
            {
              "textRaw": "`ERR_AMBIGUOUS_ARGUMENT`",
              "name": "`err_ambiguous_argument`",
              "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>assert</code> module when the\n<code>message</code> parameter in <code>assert.throws(block, message)</code> matches the error message\nthrown by <code>block</code> because that usage suggests that the user believes <code>message</code>\nis the expected message rather than the message the <code>AssertionError</code> will\ndisplay if <code>block</code> does not throw.</p>\n<p><a id=\"ERR_ARG_NOT_ITERABLE\"></a></p>",
              "type": "module",
              "displayName": "`ERR_AMBIGUOUS_ARGUMENT`"
            },
            {
              "textRaw": "`ERR_ARG_NOT_ITERABLE`",
              "name": "`err_arg_not_iterable`",
              "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>",
              "type": "module",
              "displayName": "`ERR_ARG_NOT_ITERABLE`"
            },
            {
              "textRaw": "`ERR_ASSERTION`",
              "name": "`err_assertion`",
              "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>assert</code> module.</p>\n<p><a id=\"ERR_ASYNC_CALLBACK\"></a></p>",
              "type": "module",
              "displayName": "`ERR_ASSERTION`"
            },
            {
              "textRaw": "`ERR_ASYNC_CALLBACK`",
              "name": "`err_async_callback`",
              "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_TYPE\"></a></p>",
              "type": "module",
              "displayName": "`ERR_ASYNC_CALLBACK`"
            },
            {
              "textRaw": "`ERR_ASYNC_TYPE`",
              "name": "`err_async_type`",
              "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>",
              "type": "module",
              "displayName": "`ERR_ASYNC_TYPE`"
            },
            {
              "textRaw": "`ERR_BROTLI_COMPRESSION_FAILED`",
              "name": "`err_brotli_compression_failed`",
              "desc": "<p>Data passed to a Brotli stream was not successfully compressed.</p>\n<p><a id=\"ERR_BROTLI_INVALID_PARAM\"></a></p>",
              "type": "module",
              "displayName": "`ERR_BROTLI_COMPRESSION_FAILED`"
            },
            {
              "textRaw": "`ERR_BROTLI_INVALID_PARAM`",
              "name": "`err_brotli_invalid_param`",
              "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>",
              "type": "module",
              "displayName": "`ERR_BROTLI_INVALID_PARAM`"
            },
            {
              "textRaw": "`ERR_BUFFER_CONTEXT_NOT_AVAILABLE`",
              "name": "`err_buffer_context_not_available`",
              "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>",
              "type": "module",
              "displayName": "`ERR_BUFFER_CONTEXT_NOT_AVAILABLE`"
            },
            {
              "textRaw": "`ERR_BUFFER_OUT_OF_BOUNDS`",
              "name": "`err_buffer_out_of_bounds`",
              "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>",
              "type": "module",
              "displayName": "`ERR_BUFFER_OUT_OF_BOUNDS`"
            },
            {
              "textRaw": "`ERR_BUFFER_TOO_LARGE`",
              "name": "`err_buffer_too_large`",
              "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>",
              "type": "module",
              "displayName": "`ERR_BUFFER_TOO_LARGE`"
            },
            {
              "textRaw": "`ERR_CANNOT_WATCH_SIGINT`",
              "name": "`err_cannot_watch_sigint`",
              "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>",
              "type": "module",
              "displayName": "`ERR_CANNOT_WATCH_SIGINT`"
            },
            {
              "textRaw": "`ERR_CHILD_CLOSED_BEFORE_REPLY`",
              "name": "`err_child_closed_before_reply`",
              "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>",
              "type": "module",
              "displayName": "`ERR_CHILD_CLOSED_BEFORE_REPLY`"
            },
            {
              "textRaw": "`ERR_CHILD_PROCESS_IPC_REQUIRED`",
              "name": "`err_child_process_ipc_required`",
              "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>",
              "type": "module",
              "displayName": "`ERR_CHILD_PROCESS_IPC_REQUIRED`"
            },
            {
              "textRaw": "`ERR_CHILD_PROCESS_STDIO_MAXBUFFER`",
              "name": "`err_child_process_stdio_maxbuffer`",
              "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_CONSOLE_WRITABLE_STREAM\"></a></p>",
              "type": "module",
              "displayName": "`ERR_CHILD_PROCESS_STDIO_MAXBUFFER`"
            },
            {
              "textRaw": "`ERR_CONSOLE_WRITABLE_STREAM`",
              "name": "`err_console_writable_stream`",
              "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_REQUIRED\"></a></p>",
              "type": "module",
              "displayName": "`ERR_CONSOLE_WRITABLE_STREAM`"
            },
            {
              "textRaw": "`ERR_CONSTRUCT_CALL_REQUIRED`",
              "name": "`err_construct_call_required`",
              "desc": "<p>A constructor for a class was called without <code>new</code>.</p>\n<p><a id=\"ERR_CONSTRUCT_CALL_INVALID\"></a></p>",
              "type": "module",
              "displayName": "`ERR_CONSTRUCT_CALL_REQUIRED`"
            },
            {
              "textRaw": "`ERR_CONSTRUCT_CALL_INVALID`",
              "name": "`err_construct_call_invalid`",
              "desc": "<!--\nadded: v12.5.0\n-->\n<p>A class constructor was called that is not callable.</p>\n<p><a id=\"ERR_CPU_USAGE\"></a></p>",
              "type": "module",
              "displayName": "`ERR_CONSTRUCT_CALL_INVALID`"
            },
            {
              "textRaw": "`ERR_CPU_USAGE`",
              "name": "`err_cpu_usage`",
              "desc": "<p>The native call from <code>process.cpuUsage</code> could not be processed.</p>\n<p><a id=\"ERR_CRYPTO_CUSTOM_ENGINE_NOT_SUPPORTED\"></a></p>",
              "type": "module",
              "displayName": "`ERR_CPU_USAGE`"
            },
            {
              "textRaw": "`ERR_CRYPTO_CUSTOM_ENGINE_NOT_SUPPORTED`",
              "name": "`err_crypto_custom_engine_not_supported`",
              "desc": "<p>A client certificate engine was requested that is not supported by the version\nof OpenSSL being used.</p>\n<p><a id=\"ERR_CRYPTO_ECDH_INVALID_FORMAT\"></a></p>",
              "type": "module",
              "displayName": "`ERR_CRYPTO_CUSTOM_ENGINE_NOT_SUPPORTED`"
            },
            {
              "textRaw": "`ERR_CRYPTO_ECDH_INVALID_FORMAT`",
              "name": "`err_crypto_ecdh_invalid_format`",
              "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>",
              "type": "module",
              "displayName": "`ERR_CRYPTO_ECDH_INVALID_FORMAT`"
            },
            {
              "textRaw": "`ERR_CRYPTO_ECDH_INVALID_PUBLIC_KEY`",
              "name": "`err_crypto_ecdh_invalid_public_key`",
              "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>",
              "type": "module",
              "displayName": "`ERR_CRYPTO_ECDH_INVALID_PUBLIC_KEY`"
            },
            {
              "textRaw": "`ERR_CRYPTO_ENGINE_UNKNOWN`",
              "name": "`err_crypto_engine_unknown`",
              "desc": "<p>An invalid crypto engine identifier was passed to\n<a href=\"crypto.html#crypto_crypto_setengine_engine_flags\"><code>require('crypto').setEngine()</code></a>.</p>\n<p><a id=\"ERR_CRYPTO_FIPS_FORCED\"></a></p>",
              "type": "module",
              "displayName": "`ERR_CRYPTO_ENGINE_UNKNOWN`"
            },
            {
              "textRaw": "`ERR_CRYPTO_FIPS_FORCED`",
              "name": "`err_crypto_fips_forced`",
              "desc": "<p>The <a href=\"cli.html#cli_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>crypto</code> module.</p>\n<p><a id=\"ERR_CRYPTO_FIPS_UNAVAILABLE\"></a></p>",
              "type": "module",
              "displayName": "`ERR_CRYPTO_FIPS_FORCED`"
            },
            {
              "textRaw": "`ERR_CRYPTO_FIPS_UNAVAILABLE`",
              "name": "`err_crypto_fips_unavailable`",
              "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>",
              "type": "module",
              "displayName": "`ERR_CRYPTO_FIPS_UNAVAILABLE`"
            },
            {
              "textRaw": "`ERR_CRYPTO_HASH_FINALIZED`",
              "name": "`err_crypto_hash_finalized`",
              "desc": "<p><a href=\"crypto.html#crypto_hash_digest_encoding\"><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>",
              "type": "module",
              "displayName": "`ERR_CRYPTO_HASH_FINALIZED`"
            },
            {
              "textRaw": "`ERR_CRYPTO_HASH_UPDATE_FAILED`",
              "name": "`err_crypto_hash_update_failed`",
              "desc": "<p><a href=\"crypto.html#crypto_hash_update_data_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>",
              "type": "module",
              "displayName": "`ERR_CRYPTO_HASH_UPDATE_FAILED`"
            },
            {
              "textRaw": "`ERR_CRYPTO_INCOMPATIBLE_KEY`",
              "name": "`err_crypto_incompatible_key`",
              "desc": "<p>The given crypto keys are incompatible with the attempted operation.</p>\n<p><a id=\"ERR_CRYPTO_INCOMPATIBLE_KEY_OPTIONS\"></a></p>",
              "type": "module",
              "displayName": "`ERR_CRYPTO_INCOMPATIBLE_KEY`"
            },
            {
              "textRaw": "`ERR_CRYPTO_INCOMPATIBLE_KEY_OPTIONS`",
              "name": "`err_crypto_incompatible_key_options`",
              "desc": "<p>The selected public or private key encoding is incompatible with other options.</p>\n<p><a id=\"ERR_CRYPTO_INVALID_DIGEST\"></a></p>",
              "type": "module",
              "displayName": "`ERR_CRYPTO_INCOMPATIBLE_KEY_OPTIONS`"
            },
            {
              "textRaw": "`ERR_CRYPTO_INVALID_DIGEST`",
              "name": "`err_crypto_invalid_digest`",
              "desc": "<p>An invalid <a href=\"crypto.html#crypto_crypto_gethashes\">crypto digest algorithm</a> was specified.</p>\n<p><a id=\"ERR_CRYPTO_INVALID_KEY_OBJECT_TYPE\"></a></p>",
              "type": "module",
              "displayName": "`ERR_CRYPTO_INVALID_DIGEST`"
            },
            {
              "textRaw": "`ERR_CRYPTO_INVALID_KEY_OBJECT_TYPE`",
              "name": "`err_crypto_invalid_key_object_type`",
              "desc": "<p>The given crypto key object's type is invalid for the attempted operation.</p>\n<p><a id=\"ERR_CRYPTO_INVALID_STATE\"></a></p>",
              "type": "module",
              "displayName": "`ERR_CRYPTO_INVALID_KEY_OBJECT_TYPE`"
            },
            {
              "textRaw": "`ERR_CRYPTO_INVALID_STATE`",
              "name": "`err_crypto_invalid_state`",
              "desc": "<p>A crypto method was used on an object that was in an invalid state. For\ninstance, calling <a href=\"crypto.html#crypto_cipher_getauthtag\"><code>cipher.getAuthTag()</code></a> before calling <code>cipher.final()</code>.</p>\n<p><a id=\"ERR_CRYPTO_PBKDF2_ERROR\"></a></p>",
              "type": "module",
              "displayName": "`ERR_CRYPTO_INVALID_STATE`"
            },
            {
              "textRaw": "`ERR_CRYPTO_PBKDF2_ERROR`",
              "name": "`err_crypto_pbkdf2_error`",
              "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_INVALID_PARAMETER\"></a></p>",
              "type": "module",
              "displayName": "`ERR_CRYPTO_PBKDF2_ERROR`"
            },
            {
              "textRaw": "`ERR_CRYPTO_SCRYPT_INVALID_PARAMETER`",
              "name": "`err_crypto_scrypt_invalid_parameter`",
              "desc": "<p>One or more <a href=\"crypto.html#crypto_crypto_scrypt_password_salt_keylen_options_callback\"><code>crypto.scrypt()</code></a> or <a href=\"crypto.html#crypto_crypto_scryptsync_password_salt_keylen_options\"><code>crypto.scryptSync()</code></a> parameters are\noutside their legal range.</p>\n<p><a id=\"ERR_CRYPTO_SCRYPT_NOT_SUPPORTED\"></a></p>",
              "type": "module",
              "displayName": "`ERR_CRYPTO_SCRYPT_INVALID_PARAMETER`"
            },
            {
              "textRaw": "`ERR_CRYPTO_SCRYPT_NOT_SUPPORTED`",
              "name": "`err_crypto_scrypt_not_supported`",
              "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>",
              "type": "module",
              "displayName": "`ERR_CRYPTO_SCRYPT_NOT_SUPPORTED`"
            },
            {
              "textRaw": "`ERR_CRYPTO_SIGN_KEY_REQUIRED`",
              "name": "`err_crypto_sign_key_required`",
              "desc": "<p>A signing <code>key</code> was not provided to the <a href=\"crypto.html#crypto_sign_sign_privatekey_outputencoding\"><code>sign.sign()</code></a> method.</p>\n<p><a id=\"ERR_CRYPTO_TIMING_SAFE_EQUAL_LENGTH\"></a></p>",
              "type": "module",
              "displayName": "`ERR_CRYPTO_SIGN_KEY_REQUIRED`"
            },
            {
              "textRaw": "`ERR_CRYPTO_TIMING_SAFE_EQUAL_LENGTH`",
              "name": "`err_crypto_timing_safe_equal_length`",
              "desc": "<p><a href=\"crypto.html#crypto_crypto_timingsafeequal_a_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>",
              "type": "module",
              "displayName": "`ERR_CRYPTO_TIMING_SAFE_EQUAL_LENGTH`"
            },
            {
              "textRaw": "`ERR_CRYPTO_UNKNOWN_CIPHER`",
              "name": "`err_crypto_unknown_cipher`",
              "desc": "<p>An unknown cipher was specified.</p>\n<p><a id=\"ERR_CRYPTO_UNKNOWN_DH_GROUP\"></a></p>",
              "type": "module",
              "displayName": "`ERR_CRYPTO_UNKNOWN_CIPHER`"
            },
            {
              "textRaw": "`ERR_CRYPTO_UNKNOWN_DH_GROUP`",
              "name": "`err_crypto_unknown_dh_group`",
              "desc": "<p>An unknown Diffie-Hellman group name was given. See\n<a href=\"crypto.html#crypto_crypto_getdiffiehellman_groupname\"><code>crypto.getDiffieHellman()</code></a> for a list of valid group names.</p>\n<p><a id=\"ERR_DIR_CLOSED\"></a></p>",
              "type": "module",
              "displayName": "`ERR_CRYPTO_UNKNOWN_DH_GROUP`"
            },
            {
              "textRaw": "`ERR_DIR_CLOSED`",
              "name": "`err_dir_closed`",
              "desc": "<p>The <a href=\"fs.html#fs_class_fs_dir\"><code>fs.Dir</code></a> was previously closed.</p>\n<p><a id=\"ERR_DIR_CONCURRENT_OPERATION\"></a></p>",
              "type": "module",
              "displayName": "`ERR_DIR_CLOSED`"
            },
            {
              "textRaw": "`ERR_DIR_CONCURRENT_OPERATION`",
              "name": "`err_dir_concurrent_operation`",
              "meta": {
                "added": [
                  "v12.18.1"
                ],
                "changes": []
              },
              "desc": "<p>A synchronous read or close call was attempted on an <a href=\"fs.html#fs_class_fs_dir\"><code>fs.Dir</code></a> which has\nongoing asynchronous operations.</p>\n<p><a id=\"ERR_DNS_SET_SERVERS_FAILED\"></a></p>",
              "type": "module",
              "displayName": "`ERR_DIR_CONCURRENT_OPERATION`"
            },
            {
              "textRaw": "`ERR_DNS_SET_SERVERS_FAILED`",
              "name": "`err_dns_set_servers_failed`",
              "desc": "<p><code>c-ares</code> failed to set the DNS server.</p>\n<p><a id=\"ERR_DOMAIN_CALLBACK_NOT_AVAILABLE\"></a></p>",
              "type": "module",
              "displayName": "`ERR_DNS_SET_SERVERS_FAILED`"
            },
            {
              "textRaw": "`ERR_DOMAIN_CALLBACK_NOT_AVAILABLE`",
              "name": "`err_domain_callback_not_available`",
              "desc": "<p>The <code>domain</code> module was not usable since it could not establish the required\nerror handling hooks, because\n<a href=\"process.html#process_process_setuncaughtexceptioncapturecallback_fn\"><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>",
              "type": "module",
              "displayName": "`ERR_DOMAIN_CALLBACK_NOT_AVAILABLE`"
            },
            {
              "textRaw": "`ERR_DOMAIN_CANNOT_SET_UNCAUGHT_EXCEPTION_CAPTURE`",
              "name": "`err_domain_cannot_set_uncaught_exception_capture`",
              "desc": "<p><a href=\"process.html#process_process_setuncaughtexceptioncapturecallback_fn\"><code>process.setUncaughtExceptionCaptureCallback()</code></a> could not be called\nbecause the <code>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>domain</code> module had been loaded.</p>\n<p><a id=\"ERR_ENCODING_INVALID_ENCODED_DATA\"></a></p>",
              "type": "module",
              "displayName": "`ERR_DOMAIN_CANNOT_SET_UNCAUGHT_EXCEPTION_CAPTURE`"
            },
            {
              "textRaw": "`ERR_ENCODING_INVALID_ENCODED_DATA`",
              "name": "`err_encoding_invalid_encoded_data`",
              "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>",
              "type": "module",
              "displayName": "`ERR_ENCODING_INVALID_ENCODED_DATA`"
            },
            {
              "textRaw": "`ERR_ENCODING_NOT_SUPPORTED`",
              "name": "`err_encoding_not_supported`",
              "desc": "<p>Encoding provided to <code>TextDecoder()</code> API was not one of the\n<a href=\"util.html#util_whatwg_supported_encodings\">WHATWG Supported Encodings</a>.</p>\n<p><a id=\"ERR_EXECUTION_ENVIRONMENT_NOT_AVAILABLE\"></a></p>",
              "type": "module",
              "displayName": "`ERR_ENCODING_NOT_SUPPORTED`"
            },
            {
              "textRaw": "`ERR_EXECUTION_ENVIRONMENT_NOT_AVAILABLE`",
              "name": "`err_execution_environment_not_available`",
              "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>",
              "type": "module",
              "displayName": "`ERR_EXECUTION_ENVIRONMENT_NOT_AVAILABLE`"
            },
            {
              "textRaw": "`ERR_FALSY_VALUE_REJECTION`",
              "name": "`err_falsy_value_rejection`",
              "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_FS_FILE_TOO_LARGE\"></a></p>",
              "type": "module",
              "displayName": "`ERR_FALSY_VALUE_REJECTION`"
            },
            {
              "textRaw": "`ERR_FS_FILE_TOO_LARGE`",
              "name": "`err_fs_file_too_large`",
              "desc": "<p>An attempt has been made to read a file whose size is larger than the maximum\nallowed size for a <code>Buffer</code>.</p>\n<p><a id=\"ERR_FS_INVALID_SYMLINK_TYPE\"></a></p>",
              "type": "module",
              "displayName": "`ERR_FS_FILE_TOO_LARGE`"
            },
            {
              "textRaw": "`ERR_FS_INVALID_SYMLINK_TYPE`",
              "name": "`err_fs_invalid_symlink_type`",
              "desc": "<p>An invalid symlink type was passed to the <a href=\"fs.html#fs_fs_symlink_target_path_type_callback\"><code>fs.symlink()</code></a> or\n<a href=\"fs.html#fs_fs_symlinksync_target_path_type\"><code>fs.symlinkSync()</code></a> methods.</p>\n<p><a id=\"ERR_HTTP_HEADERS_SENT\"></a></p>",
              "type": "module",
              "displayName": "`ERR_FS_INVALID_SYMLINK_TYPE`"
            },
            {
              "textRaw": "`ERR_HTTP_HEADERS_SENT`",
              "name": "`err_http_headers_sent`",
              "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>",
              "type": "module",
              "displayName": "`ERR_HTTP_HEADERS_SENT`"
            },
            {
              "textRaw": "`ERR_HTTP_INVALID_HEADER_VALUE`",
              "name": "`err_http_invalid_header_value`",
              "desc": "<p>An invalid HTTP header value was specified.</p>\n<p><a id=\"ERR_HTTP_INVALID_STATUS_CODE\"></a></p>",
              "type": "module",
              "displayName": "`ERR_HTTP_INVALID_HEADER_VALUE`"
            },
            {
              "textRaw": "`ERR_HTTP_INVALID_STATUS_CODE`",
              "name": "`err_http_invalid_status_code`",
              "desc": "<p>Status code was outside the regular status code range (100-999).</p>\n<p><a id=\"ERR_HTTP_TRAILER_INVALID\"></a></p>",
              "type": "module",
              "displayName": "`ERR_HTTP_INVALID_STATUS_CODE`"
            },
            {
              "textRaw": "`ERR_HTTP_TRAILER_INVALID`",
              "name": "`err_http_trailer_invalid`",
              "desc": "<p>The <code>Trailer</code> header was set even though the transfer encoding does not support\nthat.</p>\n<p><a id=\"ERR_HTTP2_ALTSVC_INVALID_ORIGIN\"></a></p>",
              "type": "module",
              "displayName": "`ERR_HTTP_TRAILER_INVALID`"
            },
            {
              "textRaw": "`ERR_HTTP2_ALTSVC_INVALID_ORIGIN`",
              "name": "`err_http2_altsvc_invalid_origin`",
              "desc": "<p>HTTP/2 ALTSVC frames require a valid origin.</p>\n<p><a id=\"ERR_HTTP2_ALTSVC_LENGTH\"></a></p>",
              "type": "module",
              "displayName": "`ERR_HTTP2_ALTSVC_INVALID_ORIGIN`"
            },
            {
              "textRaw": "`ERR_HTTP2_ALTSVC_LENGTH`",
              "name": "`err_http2_altsvc_length`",
              "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>",
              "type": "module",
              "displayName": "`ERR_HTTP2_ALTSVC_LENGTH`"
            },
            {
              "textRaw": "`ERR_HTTP2_CONNECT_AUTHORITY`",
              "name": "`err_http2_connect_authority`",
              "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>",
              "type": "module",
              "displayName": "`ERR_HTTP2_CONNECT_AUTHORITY`"
            },
            {
              "textRaw": "`ERR_HTTP2_CONNECT_PATH`",
              "name": "`err_http2_connect_path`",
              "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>",
              "type": "module",
              "displayName": "`ERR_HTTP2_CONNECT_PATH`"
            },
            {
              "textRaw": "`ERR_HTTP2_CONNECT_SCHEME`",
              "name": "`err_http2_connect_scheme`",
              "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>",
              "type": "module",
              "displayName": "`ERR_HTTP2_CONNECT_SCHEME`"
            },
            {
              "textRaw": "`ERR_HTTP2_ERROR`",
              "name": "`err_http2_error`",
              "desc": "<p>A non-specific HTTP/2 error has occurred.</p>\n<p><a id=\"ERR_HTTP2_GOAWAY_SESSION\"></a></p>",
              "type": "module",
              "displayName": "`ERR_HTTP2_ERROR`"
            },
            {
              "textRaw": "`ERR_HTTP2_GOAWAY_SESSION`",
              "name": "`err_http2_goaway_session`",
              "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>",
              "type": "module",
              "displayName": "`ERR_HTTP2_GOAWAY_SESSION`"
            },
            {
              "textRaw": "`ERR_HTTP2_HEADERS_AFTER_RESPOND`",
              "name": "`err_http2_headers_after_respond`",
              "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>",
              "type": "module",
              "displayName": "`ERR_HTTP2_HEADERS_AFTER_RESPOND`"
            },
            {
              "textRaw": "`ERR_HTTP2_HEADERS_SENT`",
              "name": "`err_http2_headers_sent`",
              "desc": "<p>An attempt was made to send multiple response headers.</p>\n<p><a id=\"ERR_HTTP2_HEADER_SINGLE_VALUE\"></a></p>",
              "type": "module",
              "displayName": "`ERR_HTTP2_HEADERS_SENT`"
            },
            {
              "textRaw": "`ERR_HTTP2_HEADER_SINGLE_VALUE`",
              "name": "`err_http2_header_single_value`",
              "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>",
              "type": "module",
              "displayName": "`ERR_HTTP2_HEADER_SINGLE_VALUE`"
            },
            {
              "textRaw": "`ERR_HTTP2_INFO_STATUS_NOT_ALLOWED`",
              "name": "`err_http2_info_status_not_allowed`",
              "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>",
              "type": "module",
              "displayName": "`ERR_HTTP2_INFO_STATUS_NOT_ALLOWED`"
            },
            {
              "textRaw": "`ERR_HTTP2_INVALID_CONNECTION_HEADERS`",
              "name": "`err_http2_invalid_connection_headers`",
              "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>",
              "type": "module",
              "displayName": "`ERR_HTTP2_INVALID_CONNECTION_HEADERS`"
            },
            {
              "textRaw": "`ERR_HTTP2_INVALID_HEADER_VALUE`",
              "name": "`err_http2_invalid_header_value`",
              "desc": "<p>An invalid HTTP/2 header value was specified.</p>\n<p><a id=\"ERR_HTTP2_INVALID_INFO_STATUS\"></a></p>",
              "type": "module",
              "displayName": "`ERR_HTTP2_INVALID_HEADER_VALUE`"
            },
            {
              "textRaw": "`ERR_HTTP2_INVALID_INFO_STATUS`",
              "name": "`err_http2_invalid_info_status`",
              "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>",
              "type": "module",
              "displayName": "`ERR_HTTP2_INVALID_INFO_STATUS`"
            },
            {
              "textRaw": "`ERR_HTTP2_INVALID_ORIGIN`",
              "name": "`err_http2_invalid_origin`",
              "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>",
              "type": "module",
              "displayName": "`ERR_HTTP2_INVALID_ORIGIN`"
            },
            {
              "textRaw": "`ERR_HTTP2_INVALID_PACKED_SETTINGS_LENGTH`",
              "name": "`err_http2_invalid_packed_settings_length`",
              "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>",
              "type": "module",
              "displayName": "`ERR_HTTP2_INVALID_PACKED_SETTINGS_LENGTH`"
            },
            {
              "textRaw": "`ERR_HTTP2_INVALID_PSEUDOHEADER`",
              "name": "`err_http2_invalid_pseudoheader`",
              "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>",
              "type": "module",
              "displayName": "`ERR_HTTP2_INVALID_PSEUDOHEADER`"
            },
            {
              "textRaw": "`ERR_HTTP2_INVALID_SESSION`",
              "name": "`err_http2_invalid_session`",
              "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>",
              "type": "module",
              "displayName": "`ERR_HTTP2_INVALID_SESSION`"
            },
            {
              "textRaw": "`ERR_HTTP2_INVALID_SETTING_VALUE`",
              "name": "`err_http2_invalid_setting_value`",
              "desc": "<p>An invalid value has been specified for an HTTP/2 setting.</p>\n<p><a id=\"ERR_HTTP2_INVALID_STREAM\"></a></p>",
              "type": "module",
              "displayName": "`ERR_HTTP2_INVALID_SETTING_VALUE`"
            },
            {
              "textRaw": "`ERR_HTTP2_INVALID_STREAM`",
              "name": "`err_http2_invalid_stream`",
              "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>",
              "type": "module",
              "displayName": "`ERR_HTTP2_INVALID_STREAM`"
            },
            {
              "textRaw": "`ERR_HTTP2_MAX_PENDING_SETTINGS_ACK`",
              "name": "`err_http2_max_pending_settings_ack`",
              "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>",
              "type": "module",
              "displayName": "`ERR_HTTP2_MAX_PENDING_SETTINGS_ACK`"
            },
            {
              "textRaw": "`ERR_HTTP2_NESTED_PUSH`",
              "name": "`err_http2_nested_push`",
              "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_SOCKET_MANIPULATION\"></a></p>",
              "type": "module",
              "displayName": "`ERR_HTTP2_NESTED_PUSH`"
            },
            {
              "textRaw": "`ERR_HTTP2_NO_SOCKET_MANIPULATION`",
              "name": "`err_http2_no_socket_manipulation`",
              "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>",
              "type": "module",
              "displayName": "`ERR_HTTP2_NO_SOCKET_MANIPULATION`"
            },
            {
              "textRaw": "`ERR_HTTP2_ORIGIN_LENGTH`",
              "name": "`err_http2_origin_length`",
              "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>",
              "type": "module",
              "displayName": "`ERR_HTTP2_ORIGIN_LENGTH`"
            },
            {
              "textRaw": "`ERR_HTTP2_OUT_OF_STREAMS`",
              "name": "`err_http2_out_of_streams`",
              "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>",
              "type": "module",
              "displayName": "`ERR_HTTP2_OUT_OF_STREAMS`"
            },
            {
              "textRaw": "`ERR_HTTP2_PAYLOAD_FORBIDDEN`",
              "name": "`err_http2_payload_forbidden`",
              "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>",
              "type": "module",
              "displayName": "`ERR_HTTP2_PAYLOAD_FORBIDDEN`"
            },
            {
              "textRaw": "`ERR_HTTP2_PING_CANCEL`",
              "name": "`err_http2_ping_cancel`",
              "desc": "<p>An HTTP/2 ping was canceled.</p>\n<p><a id=\"ERR_HTTP2_PING_LENGTH\"></a></p>",
              "type": "module",
              "displayName": "`ERR_HTTP2_PING_CANCEL`"
            },
            {
              "textRaw": "`ERR_HTTP2_PING_LENGTH`",
              "name": "`err_http2_ping_length`",
              "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>",
              "type": "module",
              "displayName": "`ERR_HTTP2_PING_LENGTH`"
            },
            {
              "textRaw": "`ERR_HTTP2_PSEUDOHEADER_NOT_ALLOWED`",
              "name": "`err_http2_pseudoheader_not_allowed`",
              "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>",
              "type": "module",
              "displayName": "`ERR_HTTP2_PSEUDOHEADER_NOT_ALLOWED`"
            },
            {
              "textRaw": "`ERR_HTTP2_PUSH_DISABLED`",
              "name": "`err_http2_push_disabled`",
              "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>",
              "type": "module",
              "displayName": "`ERR_HTTP2_PUSH_DISABLED`"
            },
            {
              "textRaw": "`ERR_HTTP2_SEND_FILE`",
              "name": "`err_http2_send_file`",
              "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>",
              "type": "module",
              "displayName": "`ERR_HTTP2_SEND_FILE`"
            },
            {
              "textRaw": "`ERR_HTTP2_SEND_FILE_NOSEEK`",
              "name": "`err_http2_send_file_noseek`",
              "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>",
              "type": "module",
              "displayName": "`ERR_HTTP2_SEND_FILE_NOSEEK`"
            },
            {
              "textRaw": "`ERR_HTTP2_SESSION_ERROR`",
              "name": "`err_http2_session_error`",
              "desc": "<p>The <code>Http2Session</code> closed with a non-zero error code.</p>\n<p><a id=\"ERR_HTTP2_SETTINGS_CANCEL\"></a></p>",
              "type": "module",
              "displayName": "`ERR_HTTP2_SESSION_ERROR`"
            },
            {
              "textRaw": "`ERR_HTTP2_SETTINGS_CANCEL`",
              "name": "`err_http2_settings_cancel`",
              "desc": "<p>The <code>Http2Session</code> settings canceled.</p>\n<p><a id=\"ERR_HTTP2_SOCKET_BOUND\"></a></p>",
              "type": "module",
              "displayName": "`ERR_HTTP2_SETTINGS_CANCEL`"
            },
            {
              "textRaw": "`ERR_HTTP2_SOCKET_BOUND`",
              "name": "`err_http2_socket_bound`",
              "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>",
              "type": "module",
              "displayName": "`ERR_HTTP2_SOCKET_BOUND`"
            },
            {
              "textRaw": "`ERR_HTTP2_SOCKET_UNBOUND`",
              "name": "`err_http2_socket_unbound`",
              "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>",
              "type": "module",
              "displayName": "`ERR_HTTP2_SOCKET_UNBOUND`"
            },
            {
              "textRaw": "`ERR_HTTP2_STATUS_101`",
              "name": "`err_http2_status_101`",
              "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>",
              "type": "module",
              "displayName": "`ERR_HTTP2_STATUS_101`"
            },
            {
              "textRaw": "`ERR_HTTP2_STATUS_INVALID`",
              "name": "`err_http2_status_invalid`",
              "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>",
              "type": "module",
              "displayName": "`ERR_HTTP2_STATUS_INVALID`"
            },
            {
              "textRaw": "`ERR_HTTP2_STREAM_CANCEL`",
              "name": "`err_http2_stream_cancel`",
              "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>",
              "type": "module",
              "displayName": "`ERR_HTTP2_STREAM_CANCEL`"
            },
            {
              "textRaw": "`ERR_HTTP2_STREAM_ERROR`",
              "name": "`err_http2_stream_error`",
              "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>",
              "type": "module",
              "displayName": "`ERR_HTTP2_STREAM_ERROR`"
            },
            {
              "textRaw": "`ERR_HTTP2_STREAM_SELF_DEPENDENCY`",
              "name": "`err_http2_stream_self_dependency`",
              "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_TRAILERS_ALREADY_SENT\"></a></p>",
              "type": "module",
              "displayName": "`ERR_HTTP2_STREAM_SELF_DEPENDENCY`"
            },
            {
              "textRaw": "`ERR_HTTP2_TRAILERS_ALREADY_SENT`",
              "name": "`err_http2_trailers_already_sent`",
              "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>",
              "type": "module",
              "displayName": "`ERR_HTTP2_TRAILERS_ALREADY_SENT`"
            },
            {
              "textRaw": "`ERR_HTTP2_TRAILERS_NOT_READY`",
              "name": "`err_http2_trailers_not_ready`",
              "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>",
              "type": "module",
              "displayName": "`ERR_HTTP2_TRAILERS_NOT_READY`"
            },
            {
              "textRaw": "`ERR_HTTP2_UNSUPPORTED_PROTOCOL`",
              "name": "`err_http2_unsupported_protocol`",
              "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_INTERNAL_ASSERTION\"></a></p>",
              "type": "module",
              "displayName": "`ERR_HTTP2_UNSUPPORTED_PROTOCOL`"
            },
            {
              "textRaw": "`ERR_INTERNAL_ASSERTION`",
              "name": "`err_internal_assertion`",
              "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_INCOMPATIBLE_OPTION_PAIR\"></a></p>",
              "type": "module",
              "displayName": "`ERR_INTERNAL_ASSERTION`"
            },
            {
              "textRaw": "`ERR_INCOMPATIBLE_OPTION_PAIR`",
              "name": "`err_incompatible_option_pair`",
              "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>",
              "type": "module",
              "displayName": "`ERR_INCOMPATIBLE_OPTION_PAIR`"
            },
            {
              "textRaw": "`ERR_INPUT_TYPE_NOT_ALLOWED`",
              "name": "`err_input_type_not_allowed`",
              "stability": 1,
              "stabilityText": "Experimental",
              "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>",
              "type": "module",
              "displayName": "`ERR_INPUT_TYPE_NOT_ALLOWED`"
            },
            {
              "textRaw": "`ERR_INSPECTOR_ALREADY_ACTIVATED`",
              "name": "`err_inspector_already_activated`",
              "desc": "<p>While using the <code>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>",
              "type": "module",
              "displayName": "`ERR_INSPECTOR_ALREADY_ACTIVATED`"
            },
            {
              "textRaw": "`ERR_INSPECTOR_ALREADY_CONNECTED`",
              "name": "`err_inspector_already_connected`",
              "desc": "<p>While using the <code>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>",
              "type": "module",
              "displayName": "`ERR_INSPECTOR_ALREADY_CONNECTED`"
            },
            {
              "textRaw": "`ERR_INSPECTOR_CLOSED`",
              "name": "`err_inspector_closed`",
              "desc": "<p>While using the <code>inspector</code> module, an attempt was made to use the inspector\nafter the session had already closed.</p>\n<p><a id=\"ERR_INSPECTOR_COMMAND\"></a></p>",
              "type": "module",
              "displayName": "`ERR_INSPECTOR_CLOSED`"
            },
            {
              "textRaw": "`ERR_INSPECTOR_COMMAND`",
              "name": "`err_inspector_command`",
              "desc": "<p>An error occurred while issuing a command via the <code>inspector</code> module.</p>\n<p><a id=\"ERR_INSPECTOR_NOT_ACTIVE\"></a></p>",
              "type": "module",
              "displayName": "`ERR_INSPECTOR_COMMAND`"
            },
            {
              "textRaw": "`ERR_INSPECTOR_NOT_ACTIVE`",
              "name": "`err_inspector_not_active`",
              "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>",
              "type": "module",
              "displayName": "`ERR_INSPECTOR_NOT_ACTIVE`"
            },
            {
              "textRaw": "`ERR_INSPECTOR_NOT_AVAILABLE`",
              "name": "`err_inspector_not_available`",
              "desc": "<p>The <code>inspector</code> module is not available for use.</p>\n<p><a id=\"ERR_INSPECTOR_NOT_CONNECTED\"></a></p>",
              "type": "module",
              "displayName": "`ERR_INSPECTOR_NOT_AVAILABLE`"
            },
            {
              "textRaw": "`ERR_INSPECTOR_NOT_CONNECTED`",
              "name": "`err_inspector_not_connected`",
              "desc": "<p>While using the <code>inspector</code> module, an attempt was made to use the inspector\nbefore it was connected.</p>\n<p><a id=\"ERR_INSPECTOR_NOT_WORKER\"></a></p>",
              "type": "module",
              "displayName": "`ERR_INSPECTOR_NOT_CONNECTED`"
            },
            {
              "textRaw": "`ERR_INSPECTOR_NOT_WORKER`",
              "name": "`err_inspector_not_worker`",
              "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_INVALID_ADDRESS_FAMILY\"></a></p>",
              "type": "module",
              "displayName": "`ERR_INSPECTOR_NOT_WORKER`"
            },
            {
              "textRaw": "`ERR_INVALID_ADDRESS_FAMILY`",
              "name": "`err_invalid_address_family`",
              "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>",
              "type": "module",
              "displayName": "`ERR_INVALID_ADDRESS_FAMILY`"
            },
            {
              "textRaw": "`ERR_INVALID_ARG_TYPE`",
              "name": "`err_invalid_arg_type`",
              "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>",
              "type": "module",
              "displayName": "`ERR_INVALID_ARG_TYPE`"
            },
            {
              "textRaw": "`ERR_INVALID_ARG_VALUE`",
              "name": "`err_invalid_arg_value`",
              "desc": "<p>An invalid or unsupported value was passed for a given argument.</p>\n<p><a id=\"ERR_INVALID_ASYNC_ID\"></a></p>",
              "type": "module",
              "displayName": "`ERR_INVALID_ARG_VALUE`"
            },
            {
              "textRaw": "`ERR_INVALID_ASYNC_ID`",
              "name": "`err_invalid_async_id`",
              "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>",
              "type": "module",
              "displayName": "`ERR_INVALID_ASYNC_ID`"
            },
            {
              "textRaw": "`ERR_INVALID_BUFFER_SIZE`",
              "name": "`err_invalid_buffer_size`",
              "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_CALLBACK\"></a></p>",
              "type": "module",
              "displayName": "`ERR_INVALID_BUFFER_SIZE`"
            },
            {
              "textRaw": "`ERR_INVALID_CALLBACK`",
              "name": "`err_invalid_callback`",
              "desc": "<p>A callback function was required but was not been provided to a Node.js API.</p>\n<p><a id=\"ERR_INVALID_CHAR\"></a></p>",
              "type": "module",
              "displayName": "`ERR_INVALID_CALLBACK`"
            },
            {
              "textRaw": "`ERR_INVALID_CHAR`",
              "name": "`err_invalid_char`",
              "desc": "<p>Invalid characters were detected in headers.</p>\n<p><a id=\"ERR_INVALID_CURSOR_POS\"></a></p>",
              "type": "module",
              "displayName": "`ERR_INVALID_CHAR`"
            },
            {
              "textRaw": "`ERR_INVALID_CURSOR_POS`",
              "name": "`err_invalid_cursor_pos`",
              "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>",
              "type": "module",
              "displayName": "`ERR_INVALID_CURSOR_POS`"
            },
            {
              "textRaw": "`ERR_INVALID_FD`",
              "name": "`err_invalid_fd`",
              "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>",
              "type": "module",
              "displayName": "`ERR_INVALID_FD`"
            },
            {
              "textRaw": "`ERR_INVALID_FD_TYPE`",
              "name": "`err_invalid_fd_type`",
              "desc": "<p>A file descriptor ('fd') type was not valid.</p>\n<p><a id=\"ERR_INVALID_FILE_URL_HOST\"></a></p>",
              "type": "module",
              "displayName": "`ERR_INVALID_FD_TYPE`"
            },
            {
              "textRaw": "`ERR_INVALID_FILE_URL_HOST`",
              "name": "`err_invalid_file_url_host`",
              "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>",
              "type": "module",
              "displayName": "`ERR_INVALID_FILE_URL_HOST`"
            },
            {
              "textRaw": "`ERR_INVALID_FILE_URL_PATH`",
              "name": "`err_invalid_file_url_path`",
              "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><a id=\"ERR_INVALID_HANDLE_TYPE\"></a></p>",
              "type": "module",
              "displayName": "`ERR_INVALID_FILE_URL_PATH`"
            },
            {
              "textRaw": "`ERR_INVALID_HANDLE_TYPE`",
              "name": "`err_invalid_handle_type`",
              "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#child_process_subprocess_send_message_sendhandle_options_callback\"><code>subprocess.send()</code></a> and <a href=\"process.html#process_process_send_message_sendhandle_options_callback\"><code>process.send()</code></a>\nfor more information.</p>\n<p><a id=\"ERR_INVALID_HTTP_TOKEN\"></a></p>",
              "type": "module",
              "displayName": "`ERR_INVALID_HANDLE_TYPE`"
            },
            {
              "textRaw": "`ERR_INVALID_HTTP_TOKEN`",
              "name": "`err_invalid_http_token`",
              "desc": "<p>An invalid HTTP token was supplied.</p>\n<p><a id=\"ERR_INVALID_IP_ADDRESS\"></a></p>",
              "type": "module",
              "displayName": "`ERR_INVALID_HTTP_TOKEN`"
            },
            {
              "textRaw": "`ERR_INVALID_IP_ADDRESS`",
              "name": "`err_invalid_ip_address`",
              "desc": "<p>An IP address is not valid.</p>\n<p><a id=\"ERR_INVALID_MODULE_SPECIFIER\"></a></p>",
              "type": "module",
              "displayName": "`ERR_INVALID_IP_ADDRESS`"
            },
            {
              "textRaw": "`ERR_INVALID_MODULE_SPECIFIER`",
              "name": "`err_invalid_module_specifier`",
              "desc": "<p>The imported module string is an invalid URL, package name, or package subpath\nspecifier.</p>\n<p><a id=\"ERR_INVALID_OPT_VALUE\"></a></p>",
              "type": "module",
              "displayName": "`ERR_INVALID_MODULE_SPECIFIER`"
            },
            {
              "textRaw": "`ERR_INVALID_OPT_VALUE`",
              "name": "`err_invalid_opt_value`",
              "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>",
              "type": "module",
              "displayName": "`ERR_INVALID_OPT_VALUE`"
            },
            {
              "textRaw": "`ERR_INVALID_OPT_VALUE_ENCODING`",
              "name": "`err_invalid_opt_value_encoding`",
              "desc": "<p>An invalid or unknown file encoding was passed.</p>\n<p><a id=\"ERR_INVALID_PACKAGE_CONFIG\"></a></p>",
              "type": "module",
              "displayName": "`ERR_INVALID_OPT_VALUE_ENCODING`"
            },
            {
              "textRaw": "`ERR_INVALID_PACKAGE_CONFIG`",
              "name": "`err_invalid_package_config`",
              "desc": "<p>An invalid <code>package.json</code> file was found which failed parsing.</p>\n<p><a id=\"ERR_INVALID_PACKAGE_TARGET\"></a></p>",
              "type": "module",
              "displayName": "`ERR_INVALID_PACKAGE_CONFIG`"
            },
            {
              "textRaw": "`ERR_INVALID_PACKAGE_TARGET`",
              "name": "`err_invalid_package_target`",
              "desc": "<p>The <code>package.json</code> <a href=\"esm.html#esm_package_entry_points\">exports</a> field contains an invalid target mapping value\nfor the attempted module resolution.</p>\n<p><a id=\"ERR_INVALID_PERFORMANCE_MARK\"></a></p>",
              "type": "module",
              "displayName": "`ERR_INVALID_PACKAGE_TARGET`"
            },
            {
              "textRaw": "`ERR_INVALID_PERFORMANCE_MARK`",
              "name": "`err_invalid_performance_mark`",
              "desc": "<p>While using the Performance Timing API (<code>perf_hooks</code>), a performance mark is\ninvalid.</p>\n<p><a id=\"ERR_INVALID_PROTOCOL\"></a></p>",
              "type": "module",
              "displayName": "`ERR_INVALID_PERFORMANCE_MARK`"
            },
            {
              "textRaw": "`ERR_INVALID_PROTOCOL`",
              "name": "`err_invalid_protocol`",
              "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>",
              "type": "module",
              "displayName": "`ERR_INVALID_PROTOCOL`"
            },
            {
              "textRaw": "`ERR_INVALID_REPL_EVAL_CONFIG`",
              "name": "`err_invalid_repl_eval_config`",
              "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>",
              "type": "module",
              "displayName": "`ERR_INVALID_REPL_EVAL_CONFIG`"
            },
            {
              "textRaw": "`ERR_INVALID_REPL_INPUT`",
              "name": "`err_invalid_repl_input`",
              "desc": "<p>The input may not be used in the <a href=\"repl.html\"><code>REPL</code></a>. All prohibited inputs are\ndocumented in the <a href=\"repl.html\"><code>REPL</code></a>'s documentation.</p>\n<p><a id=\"ERR_INVALID_RETURN_PROPERTY\"></a></p>",
              "type": "module",
              "displayName": "`ERR_INVALID_REPL_INPUT`"
            },
            {
              "textRaw": "`ERR_INVALID_RETURN_PROPERTY`",
              "name": "`err_invalid_return_property`",
              "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>",
              "type": "module",
              "displayName": "`ERR_INVALID_RETURN_PROPERTY`"
            },
            {
              "textRaw": "`ERR_INVALID_RETURN_PROPERTY_VALUE`",
              "name": "`err_invalid_return_property_value`",
              "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>",
              "type": "module",
              "displayName": "`ERR_INVALID_RETURN_PROPERTY_VALUE`"
            },
            {
              "textRaw": "`ERR_INVALID_RETURN_VALUE`",
              "name": "`err_invalid_return_value`",
              "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_SYNC_FORK_INPUT\"></a></p>",
              "type": "module",
              "displayName": "`ERR_INVALID_RETURN_VALUE`"
            },
            {
              "textRaw": "`ERR_INVALID_SYNC_FORK_INPUT`",
              "name": "`err_invalid_sync_fork_input`",
              "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>",
              "type": "module",
              "displayName": "`ERR_INVALID_SYNC_FORK_INPUT`"
            },
            {
              "textRaw": "`ERR_INVALID_THIS`",
              "name": "`err_invalid_this`",
              "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_TRANSFER_OBJECT\"></a></p>",
              "type": "module",
              "displayName": "`ERR_INVALID_THIS`"
            },
            {
              "textRaw": "`ERR_INVALID_TRANSFER_OBJECT`",
              "name": "`err_invalid_transfer_object`",
              "desc": "<p>An invalid transfer object was passed to <code>postMessage()</code>.</p>\n<p><a id=\"ERR_INVALID_TUPLE\"></a></p>",
              "type": "module",
              "displayName": "`ERR_INVALID_TRANSFER_OBJECT`"
            },
            {
              "textRaw": "`ERR_INVALID_TUPLE`",
              "name": "`err_invalid_tuple`",
              "desc": "<p>An element in the <code>iterable</code> provided to the <a href=\"url.html#url_the_whatwg_url_api\">WHATWG</a>\n<a href=\"url.html#url_constructor_new_urlsearchparams_iterable\"><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_URI\"></a></p>",
              "type": "module",
              "displayName": "`ERR_INVALID_TUPLE`"
            },
            {
              "textRaw": "`ERR_INVALID_URI`",
              "name": "`err_invalid_uri`",
              "desc": "<p>An invalid URI was passed.</p>\n<p><a id=\"ERR_INVALID_URL\"></a></p>",
              "type": "module",
              "displayName": "`ERR_INVALID_URI`"
            },
            {
              "textRaw": "`ERR_INVALID_URL`",
              "name": "`err_invalid_url`",
              "desc": "<p>An invalid URL was passed to the <a href=\"url.html#url_the_whatwg_url_api\">WHATWG</a>\n<a href=\"url.html#url_constructor_new_url_input_base\"><code>URL</code> constructor</a> to be parsed. The thrown error object\ntypically has an additional property <code>'input'</code> that contains the URL that failed\nto parse.</p>\n<p><a id=\"ERR_INVALID_URL_SCHEME\"></a></p>",
              "type": "module",
              "displayName": "`ERR_INVALID_URL`"
            },
            {
              "textRaw": "`ERR_INVALID_URL_SCHEME`",
              "name": "`err_invalid_url_scheme`",
              "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#url_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>",
              "type": "module",
              "displayName": "`ERR_INVALID_URL_SCHEME`"
            },
            {
              "textRaw": "`ERR_IPC_CHANNEL_CLOSED`",
              "name": "`err_ipc_channel_closed`",
              "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>",
              "type": "module",
              "displayName": "`ERR_IPC_CHANNEL_CLOSED`"
            },
            {
              "textRaw": "`ERR_IPC_DISCONNECTED`",
              "name": "`err_ipc_disconnected`",
              "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>",
              "type": "module",
              "displayName": "`ERR_IPC_DISCONNECTED`"
            },
            {
              "textRaw": "`ERR_IPC_ONE_PIPE`",
              "name": "`err_ipc_one_pipe`",
              "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>",
              "type": "module",
              "displayName": "`ERR_IPC_ONE_PIPE`"
            },
            {
              "textRaw": "`ERR_IPC_SYNC_FORK`",
              "name": "`err_ipc_sync_fork`",
              "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_MANIFEST_ASSERT_INTEGRITY\"></a></p>",
              "type": "module",
              "displayName": "`ERR_IPC_SYNC_FORK`"
            },
            {
              "textRaw": "`ERR_MANIFEST_ASSERT_INTEGRITY`",
              "name": "`err_manifest_assert_integrity`",
              "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 <a href=\"policy.html\">policy</a>\nmanifests for more information.</p>\n<p><a id=\"ERR_MANIFEST_DEPENDENCY_MISSING\"></a></p>",
              "type": "module",
              "displayName": "`ERR_MANIFEST_ASSERT_INTEGRITY`"
            },
            {
              "textRaw": "`ERR_MANIFEST_DEPENDENCY_MISSING`",
              "name": "`err_manifest_dependency_missing`",
              "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 <a href=\"policy.html\">policy</a> manifests for more information.</p>\n<p><a id=\"ERR_MANIFEST_INTEGRITY_MISMATCH\"></a></p>",
              "type": "module",
              "displayName": "`ERR_MANIFEST_DEPENDENCY_MISSING`"
            },
            {
              "textRaw": "`ERR_MANIFEST_INTEGRITY_MISMATCH`",
              "name": "`err_manifest_integrity_mismatch`",
              "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\n<a href=\"policy.html\">policy</a> manifests for more information.</p>\n<p><a id=\"ERR_MANIFEST_INVALID_RESOURCE_FIELD\"></a></p>",
              "type": "module",
              "displayName": "`ERR_MANIFEST_INTEGRITY_MISMATCH`"
            },
            {
              "textRaw": "`ERR_MANIFEST_INVALID_RESOURCE_FIELD`",
              "name": "`err_manifest_invalid_resource_field`",
              "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 <a href=\"policy.html\">policy</a> manifests for more information.</p>\n<p><a id=\"ERR_MANIFEST_PARSE_POLICY\"></a></p>",
              "type": "module",
              "displayName": "`ERR_MANIFEST_INVALID_RESOURCE_FIELD`"
            },
            {
              "textRaw": "`ERR_MANIFEST_PARSE_POLICY`",
              "name": "`err_manifest_parse_policy`",
              "desc": "<p>An attempt was made to load a policy manifest, but the manifest was unable to\nbe parsed. See the documentation for <a href=\"policy.html\">policy</a> manifests for more information.</p>\n<p><a id=\"ERR_MANIFEST_TDZ\"></a></p>",
              "type": "module",
              "displayName": "`ERR_MANIFEST_PARSE_POLICY`"
            },
            {
              "textRaw": "`ERR_MANIFEST_TDZ`",
              "name": "`err_manifest_tdz`",
              "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>",
              "type": "module",
              "displayName": "`ERR_MANIFEST_TDZ`"
            },
            {
              "textRaw": "`ERR_MANIFEST_UNKNOWN_ONERROR`",
              "name": "`err_manifest_unknown_onerror`",
              "desc": "<p>A policy manifest was loaded, but had an unknown value for its \"onerror\"\nbehavior. See the documentation for <a href=\"policy.html\">policy</a> manifests for more information.</p>\n<p><a id=\"ERR_MEMORY_ALLOCATION_FAILED\"></a></p>",
              "type": "module",
              "displayName": "`ERR_MANIFEST_UNKNOWN_ONERROR`"
            },
            {
              "textRaw": "`ERR_MEMORY_ALLOCATION_FAILED`",
              "name": "`err_memory_allocation_failed`",
              "desc": "<p>An attempt was made to allocate memory (usually in the C++ layer) but it\nfailed.</p>\n<p><a id=\"ERR_METHOD_NOT_IMPLEMENTED\"></a></p>",
              "type": "module",
              "displayName": "`ERR_MEMORY_ALLOCATION_FAILED`"
            },
            {
              "textRaw": "`ERR_METHOD_NOT_IMPLEMENTED`",
              "name": "`err_method_not_implemented`",
              "desc": "<p>A method is required but not implemented.</p>\n<p><a id=\"ERR_MISSING_ARGS\"></a></p>",
              "type": "module",
              "displayName": "`ERR_METHOD_NOT_IMPLEMENTED`"
            },
            {
              "textRaw": "`ERR_MISSING_ARGS`",
              "name": "`err_missing_args`",
              "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=\"errors.html#ERR_INVALID_ARG_TYPE\"><code>ERR_INVALID_ARG_TYPE</code></a> error code may be used instead.</p>\n<p><a id=\"ERR_MISSING_DYNAMIC_INSTANTIATE_HOOK\"></a></p>",
              "type": "module",
              "displayName": "`ERR_MISSING_ARGS`"
            },
            {
              "textRaw": "`ERR_MISSING_DYNAMIC_INSTANTIATE_HOOK`",
              "name": "`err_missing_dynamic_instantiate_hook`",
              "stability": 1,
              "stabilityText": "Experimental",
              "desc": "<p>An <a href=\"esm.html\">ES Module</a> loader hook specified <code>format: 'dynamic'</code> but did not provide\na <code>dynamicInstantiate</code> hook.</p>\n<p><a id=\"ERR_MISSING_OPTION\"></a></p>",
              "type": "module",
              "displayName": "`ERR_MISSING_DYNAMIC_INSTANTIATE_HOOK`"
            },
            {
              "textRaw": "`ERR_MISSING_OPTION`",
              "name": "`err_missing_option`",
              "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_MESSAGE_PORT_IN_TRANSFER_LIST\"></a></p>",
              "type": "module",
              "displayName": "`ERR_MISSING_OPTION`"
            },
            {
              "textRaw": "`ERR_MISSING_MESSAGE_PORT_IN_TRANSFER_LIST`",
              "name": "`err_missing_message_port_in_transfer_list`",
              "desc": "<p>A <code>MessagePort</code> was found in the object passed to a <code>postMessage()</code> call,\nbut not provided in the <code>transferList</code> for that call.</p>\n<p><a id=\"ERR_MISSING_PASSPHRASE\"></a></p>",
              "type": "module",
              "displayName": "`ERR_MISSING_MESSAGE_PORT_IN_TRANSFER_LIST`"
            },
            {
              "textRaw": "`ERR_MISSING_PASSPHRASE`",
              "name": "`err_missing_passphrase`",
              "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>",
              "type": "module",
              "displayName": "`ERR_MISSING_PASSPHRASE`"
            },
            {
              "textRaw": "`ERR_MISSING_PLATFORM_FOR_WORKER`",
              "name": "`err_missing_platform_for_worker`",
              "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_NOT_FOUND\"></a></p>",
              "type": "module",
              "displayName": "`ERR_MISSING_PLATFORM_FOR_WORKER`"
            },
            {
              "textRaw": "`ERR_MODULE_NOT_FOUND`",
              "name": "`err_module_not_found`",
              "stability": 1,
              "stabilityText": "Experimental",
              "desc": "<p>An <a href=\"esm.html\">ES Module</a> could not be resolved.</p>\n<p><a id=\"ERR_MULTIPLE_CALLBACK\"></a></p>",
              "type": "module",
              "displayName": "`ERR_MODULE_NOT_FOUND`"
            },
            {
              "textRaw": "`ERR_MULTIPLE_CALLBACK`",
              "name": "`err_multiple_callback`",
              "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>",
              "type": "module",
              "displayName": "`ERR_MULTIPLE_CALLBACK`"
            },
            {
              "textRaw": "`ERR_NAPI_CONS_FUNCTION`",
              "name": "`err_napi_cons_function`",
              "desc": "<p>While using <code>N-API</code>, a constructor passed was not a function.</p>\n<p><a id=\"ERR_NAPI_INVALID_DATAVIEW_ARGS\"></a></p>",
              "type": "module",
              "displayName": "`ERR_NAPI_CONS_FUNCTION`"
            },
            {
              "textRaw": "`ERR_NAPI_INVALID_DATAVIEW_ARGS`",
              "name": "`err_napi_invalid_dataview_args`",
              "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>",
              "type": "module",
              "displayName": "`ERR_NAPI_INVALID_DATAVIEW_ARGS`"
            },
            {
              "textRaw": "`ERR_NAPI_INVALID_TYPEDARRAY_ALIGNMENT`",
              "name": "`err_napi_invalid_typedarray_alignment`",
              "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>",
              "type": "module",
              "displayName": "`ERR_NAPI_INVALID_TYPEDARRAY_ALIGNMENT`"
            },
            {
              "textRaw": "`ERR_NAPI_INVALID_TYPEDARRAY_LENGTH`",
              "name": "`err_napi_invalid_typedarray_length`",
              "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>",
              "type": "module",
              "displayName": "`ERR_NAPI_INVALID_TYPEDARRAY_LENGTH`"
            },
            {
              "textRaw": "`ERR_NAPI_TSFN_CALL_JS`",
              "name": "`err_napi_tsfn_call_js`",
              "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>",
              "type": "module",
              "displayName": "`ERR_NAPI_TSFN_CALL_JS`"
            },
            {
              "textRaw": "`ERR_NAPI_TSFN_GET_UNDEFINED`",
              "name": "`err_napi_tsfn_get_undefined`",
              "desc": "<p>An error occurred while attempting to retrieve the JavaScript <code>undefined</code>\nvalue.</p>\n<p><a id=\"ERR_NAPI_TSFN_START_IDLE_LOOP\"></a></p>",
              "type": "module",
              "displayName": "`ERR_NAPI_TSFN_GET_UNDEFINED`"
            },
            {
              "textRaw": "`ERR_NAPI_TSFN_START_IDLE_LOOP`",
              "name": "`err_napi_tsfn_start_idle_loop`",
              "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>",
              "type": "module",
              "displayName": "`ERR_NAPI_TSFN_START_IDLE_LOOP`"
            },
            {
              "textRaw": "`ERR_NAPI_TSFN_STOP_IDLE_LOOP`",
              "name": "`err_napi_tsfn_stop_idle_loop`",
              "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_CRYPTO\"></a></p>",
              "type": "module",
              "displayName": "`ERR_NAPI_TSFN_STOP_IDLE_LOOP`"
            },
            {
              "textRaw": "`ERR_NO_CRYPTO`",
              "name": "`err_no_crypto`",
              "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>",
              "type": "module",
              "displayName": "`ERR_NO_CRYPTO`"
            },
            {
              "textRaw": "`ERR_NO_ICU`",
              "name": "`err_no_icu`",
              "desc": "<p>An attempt was made to use features that require <a href=\"intl.html#intl_internationalization_support\">ICU</a>, but Node.js was not\ncompiled with ICU support.</p>\n<p><a id=\"ERR_NON_CONTEXT_AWARE_DISABLED\"></a></p>",
              "type": "module",
              "displayName": "`ERR_NO_ICU`"
            },
            {
              "textRaw": "`ERR_NON_CONTEXT_AWARE_DISABLED`",
              "name": "`err_non_context_aware_disabled`",
              "desc": "<p>A non-context-aware native addon was loaded in a process that disallows them.</p>\n<p><a id=\"ERR_OUT_OF_RANGE\"></a></p>",
              "type": "module",
              "displayName": "`ERR_NON_CONTEXT_AWARE_DISABLED`"
            },
            {
              "textRaw": "`ERR_OUT_OF_RANGE`",
              "name": "`err_out_of_range`",
              "desc": "<p>A given value is out of the accepted range.</p>\n<p><a id=\"ERR_PACKAGE_PATH_NOT_EXPORTED\"></a></p>",
              "type": "module",
              "displayName": "`ERR_OUT_OF_RANGE`"
            },
            {
              "textRaw": "`ERR_PACKAGE_PATH_NOT_EXPORTED`",
              "name": "`err_package_path_not_exported`",
              "desc": "<p>The <code>package.json</code> <a href=\"esm.html#esm_package_entry_points\">exports</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_PROTO_ACCESS\"></a></p>",
              "type": "module",
              "displayName": "`ERR_PACKAGE_PATH_NOT_EXPORTED`"
            },
            {
              "textRaw": "`ERR_PROTO_ACCESS`",
              "name": "`err_proto_access`",
              "desc": "<p>Accessing <code>Object.prototype.__proto__</code> has been forbidden using\n<a href=\"cli.html#cli_disable_proto_mode\"><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_REQUIRE_ESM\"></a></p>",
              "type": "module",
              "displayName": "`ERR_PROTO_ACCESS`"
            },
            {
              "textRaw": "`ERR_REQUIRE_ESM`",
              "name": "`err_require_esm`",
              "stability": 1,
              "stabilityText": "Experimental",
              "desc": "<p>An attempt was made to <code>require()</code> an <a href=\"esm.html\">ES Module</a>.</p>\n<p><a id=\"ERR_SCRIPT_EXECUTION_INTERRUPTED\"></a></p>",
              "type": "module",
              "displayName": "`ERR_REQUIRE_ESM`"
            },
            {
              "textRaw": "`ERR_SCRIPT_EXECUTION_INTERRUPTED`",
              "name": "`err_script_execution_interrupted`",
              "desc": "<p>Script execution was interrupted by <code>SIGINT</code> (For example, when Ctrl+C was\npressed).</p>\n<p><a id=\"ERR_SCRIPT_EXECUTION_TIMEOUT\"></a></p>",
              "type": "module",
              "displayName": "`ERR_SCRIPT_EXECUTION_INTERRUPTED`"
            },
            {
              "textRaw": "`ERR_SCRIPT_EXECUTION_TIMEOUT`",
              "name": "`err_script_execution_timeout`",
              "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>",
              "type": "module",
              "displayName": "`ERR_SCRIPT_EXECUTION_TIMEOUT`"
            },
            {
              "textRaw": "`ERR_SERVER_ALREADY_LISTEN`",
              "name": "`err_server_already_listen`",
              "desc": "<p>The <a href=\"net.html#net_server_listen\"><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>",
              "type": "module",
              "displayName": "`ERR_SERVER_ALREADY_LISTEN`"
            },
            {
              "textRaw": "`ERR_SERVER_NOT_RUNNING`",
              "name": "`err_server_not_running`",
              "desc": "<p>The <a href=\"net.html#net_server_close_callback\"><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_SOCKET_ALREADY_BOUND\"></a></p>",
              "type": "module",
              "displayName": "`ERR_SERVER_NOT_RUNNING`"
            },
            {
              "textRaw": "`ERR_SOCKET_ALREADY_BOUND`",
              "name": "`err_socket_already_bound`",
              "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>",
              "type": "module",
              "displayName": "`ERR_SOCKET_ALREADY_BOUND`"
            },
            {
              "textRaw": "`ERR_SOCKET_BAD_BUFFER_SIZE`",
              "name": "`err_socket_bad_buffer_size`",
              "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#dgram_dgram_createsocket_options_callback\"><code>dgram.createSocket()</code></a>.</p>\n<p><a id=\"ERR_SOCKET_BAD_PORT\"></a></p>",
              "type": "module",
              "displayName": "`ERR_SOCKET_BAD_BUFFER_SIZE`"
            },
            {
              "textRaw": "`ERR_SOCKET_BAD_PORT`",
              "name": "`err_socket_bad_port`",
              "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>",
              "type": "module",
              "displayName": "`ERR_SOCKET_BAD_PORT`"
            },
            {
              "textRaw": "`ERR_SOCKET_BAD_TYPE`",
              "name": "`err_socket_bad_type`",
              "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>",
              "type": "module",
              "displayName": "`ERR_SOCKET_BAD_TYPE`"
            },
            {
              "textRaw": "`ERR_SOCKET_BUFFER_SIZE`",
              "name": "`err_socket_buffer_size`",
              "desc": "<p>While using <a href=\"dgram.html#dgram_dgram_createsocket_options_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_CANNOT_SEND\"></a></p>",
              "type": "module",
              "displayName": "`ERR_SOCKET_BUFFER_SIZE`"
            },
            {
              "textRaw": "`ERR_SOCKET_CANNOT_SEND`",
              "name": "`err_socket_cannot_send`",
              "desc": "<p>Data could be sent on a socket.</p>\n<p><a id=\"ERR_SOCKET_CLOSED\"></a></p>",
              "type": "module",
              "displayName": "`ERR_SOCKET_CANNOT_SEND`"
            },
            {
              "textRaw": "`ERR_SOCKET_CLOSED`",
              "name": "`err_socket_closed`",
              "desc": "<p>An attempt was made to operate on an already closed socket.</p>\n<p><a id=\"ERR_SOCKET_DGRAM_IS_CONNECTED\"></a></p>",
              "type": "module",
              "displayName": "`ERR_SOCKET_CLOSED`"
            },
            {
              "textRaw": "`ERR_SOCKET_DGRAM_IS_CONNECTED`",
              "name": "`err_socket_dgram_is_connected`",
              "desc": "<p>A <a href=\"dgram.html#dgram_socket_connect_port_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>",
              "type": "module",
              "displayName": "`ERR_SOCKET_DGRAM_IS_CONNECTED`"
            },
            {
              "textRaw": "`ERR_SOCKET_DGRAM_NOT_CONNECTED`",
              "name": "`err_socket_dgram_not_connected`",
              "desc": "<p>A <a href=\"dgram.html#dgram_socket_disconnect\"><code>dgram.disconnect()</code></a> or <a href=\"dgram.html#dgram_socket_remoteaddress\"><code>dgram.remoteAddress()</code></a> call was made on a\ndisconnected socket.</p>\n<p><a id=\"ERR_SOCKET_DGRAM_NOT_RUNNING\"></a></p>",
              "type": "module",
              "displayName": "`ERR_SOCKET_DGRAM_NOT_CONNECTED`"
            },
            {
              "textRaw": "`ERR_SOCKET_DGRAM_NOT_RUNNING`",
              "name": "`err_socket_dgram_not_running`",
              "desc": "<p>A call was made and the UDP subsystem was not running.</p>\n<p><a id=\"ERR_SRI_PARSE\"></a></p>",
              "type": "module",
              "displayName": "`ERR_SOCKET_DGRAM_NOT_RUNNING`"
            },
            {
              "textRaw": "`ERR_SRI_PARSE`",
              "name": "`err_sri_parse`",
              "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_CANNOT_PIPE\"></a></p>",
              "type": "module",
              "displayName": "`ERR_SRI_PARSE`"
            },
            {
              "textRaw": "`ERR_STREAM_CANNOT_PIPE`",
              "name": "`err_stream_cannot_pipe`",
              "desc": "<p>An attempt was made to call <a href=\"stream.html#stream_readable_pipe_destination_options\"><code>stream.pipe()</code></a> on a <a href=\"stream.html#stream_class_stream_writable\"><code>Writable</code></a> stream.</p>\n<p><a id=\"ERR_STREAM_DESTROYED\"></a></p>",
              "type": "module",
              "displayName": "`ERR_STREAM_CANNOT_PIPE`"
            },
            {
              "textRaw": "`ERR_STREAM_DESTROYED`",
              "name": "`err_stream_destroyed`",
              "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_NULL_VALUES\"></a></p>",
              "type": "module",
              "displayName": "`ERR_STREAM_DESTROYED`"
            },
            {
              "textRaw": "`ERR_STREAM_NULL_VALUES`",
              "name": "`err_stream_null_values`",
              "desc": "<p>An attempt was made to call <a href=\"stream.html#stream_writable_write_chunk_encoding_callback\"><code>stream.write()</code></a> with a <code>null</code> chunk.</p>\n<p><a id=\"ERR_STREAM_PREMATURE_CLOSE\"></a></p>",
              "type": "module",
              "displayName": "`ERR_STREAM_NULL_VALUES`"
            },
            {
              "textRaw": "`ERR_STREAM_PREMATURE_CLOSE`",
              "name": "`err_stream_premature_close`",
              "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>",
              "type": "module",
              "displayName": "`ERR_STREAM_PREMATURE_CLOSE`"
            },
            {
              "textRaw": "`ERR_STREAM_PUSH_AFTER_EOF`",
              "name": "`err_stream_push_after_eof`",
              "desc": "<p>An attempt was made to call <a href=\"stream.html#stream_readable_push_chunk_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_UNSHIFT_AFTER_END_EVENT\"></a></p>",
              "type": "module",
              "displayName": "`ERR_STREAM_PUSH_AFTER_EOF`"
            },
            {
              "textRaw": "`ERR_STREAM_UNSHIFT_AFTER_END_EVENT`",
              "name": "`err_stream_unshift_after_end_event`",
              "desc": "<p>An attempt was made to call <a href=\"stream.html#stream_readable_unshift_chunk_encoding\"><code>stream.unshift()</code></a> after the <code>'end'</code> event was\nemitted.</p>\n<p><a id=\"ERR_STREAM_WRAP\"></a></p>",
              "type": "module",
              "displayName": "`ERR_STREAM_UNSHIFT_AFTER_END_EVENT`"
            },
            {
              "textRaw": "`ERR_STREAM_WRAP`",
              "name": "`err_stream_wrap`",
              "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('net').Socket;\nconst instance = new Socket();\n\ninstance.setEncoding('utf8');\n</code></pre>\n<p><a id=\"ERR_STREAM_WRITE_AFTER_END\"></a></p>",
              "type": "module",
              "displayName": "`ERR_STREAM_WRAP`"
            },
            {
              "textRaw": "`ERR_STREAM_WRITE_AFTER_END`",
              "name": "`err_stream_write_after_end`",
              "desc": "<p>An attempt was made to call <a href=\"stream.html#stream_writable_write_chunk_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>",
              "type": "module",
              "displayName": "`ERR_STREAM_WRITE_AFTER_END`"
            },
            {
              "textRaw": "`ERR_STRING_TOO_LONG`",
              "name": "`err_string_too_long`",
              "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>",
              "type": "module",
              "displayName": "`ERR_STRING_TOO_LONG`"
            },
            {
              "textRaw": "`ERR_SYNTHETIC`",
              "name": "`err_synthetic`",
              "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>",
              "type": "module",
              "displayName": "`ERR_SYNTHETIC`"
            },
            {
              "textRaw": "`ERR_SYSTEM_ERROR`",
              "name": "`err_system_error`",
              "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_TLS_CERT_ALTNAME_INVALID\"></a></p>",
              "type": "module",
              "displayName": "`ERR_SYSTEM_ERROR`"
            },
            {
              "textRaw": "`ERR_TLS_CERT_ALTNAME_INVALID`",
              "name": "`err_tls_cert_altname_invalid`",
              "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>",
              "type": "module",
              "displayName": "`ERR_TLS_CERT_ALTNAME_INVALID`"
            },
            {
              "textRaw": "`ERR_TLS_DH_PARAM_SIZE`",
              "name": "`err_tls_dh_param_size`",
              "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>",
              "type": "module",
              "displayName": "`ERR_TLS_DH_PARAM_SIZE`"
            },
            {
              "textRaw": "`ERR_TLS_HANDSHAKE_TIMEOUT`",
              "name": "`err_tls_handshake_timeout`",
              "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>",
              "type": "module",
              "displayName": "`ERR_TLS_HANDSHAKE_TIMEOUT`"
            },
            {
              "textRaw": "`ERR_TLS_INVALID_CONTEXT`",
              "name": "`err_tls_invalid_context`",
              "meta": {
                "added": [
                  "v12.16.0"
                ],
                "changes": []
              },
              "desc": "<p>The context must be a <code>SecureContext</code>.</p>\n<p><a id=\"ERR_TLS_INVALID_STATE\"></a></p>",
              "type": "module",
              "displayName": "`ERR_TLS_INVALID_CONTEXT`"
            },
            {
              "textRaw": "`ERR_TLS_INVALID_STATE`",
              "name": "`err_tls_invalid_state`",
              "meta": {
                "added": [
                  "v12.17.0"
                ],
                "changes": []
              },
              "desc": "<p>The TLS socket must be connected and securily established. Ensure the 'secure'\nevent is emitted before continuing.</p>\n<p><a id=\"ERR_TLS_INVALID_PROTOCOL_METHOD\"></a></p>",
              "type": "module",
              "displayName": "`ERR_TLS_INVALID_STATE`"
            },
            {
              "textRaw": "`ERR_TLS_INVALID_PROTOCOL_METHOD`",
              "name": "`err_tls_invalid_protocol_method`",
              "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>",
              "type": "module",
              "displayName": "`ERR_TLS_INVALID_PROTOCOL_METHOD`"
            },
            {
              "textRaw": "`ERR_TLS_INVALID_PROTOCOL_VERSION`",
              "name": "`err_tls_invalid_protocol_version`",
              "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_PROTOCOL_VERSION_CONFLICT\"></a></p>",
              "type": "module",
              "displayName": "`ERR_TLS_INVALID_PROTOCOL_VERSION`"
            },
            {
              "textRaw": "`ERR_TLS_PROTOCOL_VERSION_CONFLICT`",
              "name": "`err_tls_protocol_version_conflict`",
              "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_RENEGOTIATION_DISABLED\"></a></p>",
              "type": "module",
              "displayName": "`ERR_TLS_PROTOCOL_VERSION_CONFLICT`"
            },
            {
              "textRaw": "`ERR_TLS_RENEGOTIATION_DISABLED`",
              "name": "`err_tls_renegotiation_disabled`",
              "desc": "<p>An attempt was made to renegotiate TLS on a socket instance with TLS disabled.</p>\n<p><a id=\"ERR_TLS_REQUIRED_SERVER_NAME\"></a></p>",
              "type": "module",
              "displayName": "`ERR_TLS_RENEGOTIATION_DISABLED`"
            },
            {
              "textRaw": "`ERR_TLS_REQUIRED_SERVER_NAME`",
              "name": "`err_tls_required_server_name`",
              "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>",
              "type": "module",
              "displayName": "`ERR_TLS_REQUIRED_SERVER_NAME`"
            },
            {
              "textRaw": "`ERR_TLS_SESSION_ATTACK`",
              "name": "`err_tls_session_attack`",
              "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>",
              "type": "module",
              "displayName": "`ERR_TLS_SESSION_ATTACK`"
            },
            {
              "textRaw": "`ERR_TLS_SNI_FROM_SERVER`",
              "name": "`err_tls_sni_from_server`",
              "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_TLS_PSK_SET_IDENTIY_HINT_FAILED\"></a></p>",
              "type": "module",
              "displayName": "`ERR_TLS_SNI_FROM_SERVER`"
            },
            {
              "textRaw": "ERR_TLS_PSK_SET_IDENTIY_HINT_FAILED",
              "name": "err_tls_psk_set_identiy_hint_failed",
              "desc": "<p>Failed to set PSK identity hint. Hint may be too long.</p>\n<p><a id=\"ERR_TRACE_EVENTS_CATEGORY_REQUIRED\"></a></p>",
              "type": "module",
              "displayName": "ERR_TLS_PSK_SET_IDENTIY_HINT_FAILED"
            },
            {
              "textRaw": "`ERR_TRACE_EVENTS_CATEGORY_REQUIRED`",
              "name": "`err_trace_events_category_required`",
              "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>",
              "type": "module",
              "displayName": "`ERR_TRACE_EVENTS_CATEGORY_REQUIRED`"
            },
            {
              "textRaw": "`ERR_TRACE_EVENTS_UNAVAILABLE`",
              "name": "`err_trace_events_unavailable`",
              "desc": "<p>The <code>trace_events</code> module could not be loaded because Node.js was compiled with\nthe <code>--without-v8-platform</code> flag.</p>\n<p><a id=\"ERR_TRANSFERRING_EXTERNALIZED_SHAREDARRAYBUFFER\"></a></p>",
              "type": "module",
              "displayName": "`ERR_TRACE_EVENTS_UNAVAILABLE`"
            },
            {
              "textRaw": "`ERR_TRANSFERRING_EXTERNALIZED_SHAREDARRAYBUFFER`",
              "name": "`err_transferring_externalized_sharedarraybuffer`",
              "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_TRANSFORM_ALREADY_TRANSFORMING\"></a></p>",
              "type": "module",
              "displayName": "`ERR_TRANSFERRING_EXTERNALIZED_SHAREDARRAYBUFFER`"
            },
            {
              "textRaw": "`ERR_TRANSFORM_ALREADY_TRANSFORMING`",
              "name": "`err_transform_already_transforming`",
              "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>",
              "type": "module",
              "displayName": "`ERR_TRANSFORM_ALREADY_TRANSFORMING`"
            },
            {
              "textRaw": "`ERR_TRANSFORM_WITH_LENGTH_0`",
              "name": "`err_transform_with_length_0`",
              "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>",
              "type": "module",
              "displayName": "`ERR_TRANSFORM_WITH_LENGTH_0`"
            },
            {
              "textRaw": "`ERR_TTY_INIT_FAILED`",
              "name": "`err_tty_init_failed`",
              "desc": "<p>The initialization of a TTY failed due to a system error.</p>\n<p><a id=\"ERR_UNCAUGHT_EXCEPTION_CAPTURE_ALREADY_SET\"></a></p>",
              "type": "module",
              "displayName": "`ERR_TTY_INIT_FAILED`"
            },
            {
              "textRaw": "`ERR_UNCAUGHT_EXCEPTION_CAPTURE_ALREADY_SET`",
              "name": "`err_uncaught_exception_capture_already_set`",
              "desc": "<p><a href=\"process.html#process_process_setuncaughtexceptioncapturecallback_fn\"><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>",
              "type": "module",
              "displayName": "`ERR_UNCAUGHT_EXCEPTION_CAPTURE_ALREADY_SET`"
            },
            {
              "textRaw": "`ERR_UNESCAPED_CHARACTERS`",
              "name": "`err_unescaped_characters`",
              "desc": "<p>A string that contained unescaped characters was received.</p>\n<p><a id=\"ERR_UNHANDLED_ERROR\"></a></p>",
              "type": "module",
              "displayName": "`ERR_UNESCAPED_CHARACTERS`"
            },
            {
              "textRaw": "`ERR_UNHANDLED_ERROR`",
              "name": "`err_unhandled_error`",
              "desc": "<p>An unhandled error occurred (for instance, when an <code>'error'</code> event is emitted\nby an <a href=\"events.html#events_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>",
              "type": "module",
              "displayName": "`ERR_UNHANDLED_ERROR`"
            },
            {
              "textRaw": "`ERR_UNKNOWN_BUILTIN_MODULE`",
              "name": "`err_unknown_builtin_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>",
              "type": "module",
              "displayName": "`ERR_UNKNOWN_BUILTIN_MODULE`"
            },
            {
              "textRaw": "`ERR_UNKNOWN_CREDENTIAL`",
              "name": "`err_unknown_credential`",
              "desc": "<p>A Unix group or user identifier that does not exist was passed.</p>\n<p><a id=\"ERR_UNKNOWN_ENCODING\"></a></p>",
              "type": "module",
              "displayName": "`ERR_UNKNOWN_CREDENTIAL`"
            },
            {
              "textRaw": "`ERR_UNKNOWN_ENCODING`",
              "name": "`err_unknown_encoding`",
              "desc": "<p>An invalid or unknown encoding option was passed to an API.</p>\n<p><a id=\"ERR_UNKNOWN_FILE_EXTENSION\"></a></p>",
              "type": "module",
              "displayName": "`ERR_UNKNOWN_ENCODING`"
            },
            {
              "textRaw": "`ERR_UNKNOWN_FILE_EXTENSION`",
              "name": "`err_unknown_file_extension`",
              "stability": 1,
              "stabilityText": "Experimental",
              "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>",
              "type": "module",
              "displayName": "`ERR_UNKNOWN_FILE_EXTENSION`"
            },
            {
              "textRaw": "`ERR_UNKNOWN_MODULE_FORMAT`",
              "name": "`err_unknown_module_format`",
              "stability": 1,
              "stabilityText": "Experimental",
              "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>",
              "type": "module",
              "displayName": "`ERR_UNKNOWN_MODULE_FORMAT`"
            },
            {
              "textRaw": "`ERR_UNKNOWN_SIGNAL`",
              "name": "`err_unknown_signal`",
              "desc": "<p>An invalid or unknown process signal was passed to an API expecting a valid\nsignal (such as <a href=\"child_process.html#child_process_subprocess_kill_signal\"><code>subprocess.kill()</code></a>).</p>\n<p><a id=\"ERR_UNSUPPORTED_DIR_IMPORT\"></a></p>",
              "type": "module",
              "displayName": "`ERR_UNKNOWN_SIGNAL`"
            },
            {
              "textRaw": "`ERR_UNSUPPORTED_DIR_IMPORT`",
              "name": "`err_unsupported_dir_import`",
              "desc": "<p><code>import</code> a directory URL is unsupported. Instead, you can\n<a href=\"esm.html#esm_self_referencing_a_package_using_its_name\">self-reference a package using its name</a> and <a href=\"esm.html#esm_subpath_exports\">define a custom subpath</a> in\nthe <code>\"exports\"</code> field of the <code>package.json</code> file.</p>\n<!-- eslint-skip -->\n<pre><code class=\"language-js\">import './'; // unsupported\nimport './index.js'; // supported\nimport 'package-name'; // supported\n</code></pre>\n<p><a id=\"ERR_UNSUPPORTED_ESM_URL_SCHEME\"></a></p>",
              "type": "module",
              "displayName": "`ERR_UNSUPPORTED_DIR_IMPORT`"
            },
            {
              "textRaw": "`ERR_UNSUPPORTED_ESM_URL_SCHEME`",
              "name": "`err_unsupported_esm_url_scheme`",
              "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_V8BREAKITERATOR\"></a></p>",
              "type": "module",
              "displayName": "`ERR_UNSUPPORTED_ESM_URL_SCHEME`"
            },
            {
              "textRaw": "`ERR_V8BREAKITERATOR`",
              "name": "`err_v8breakiterator`",
              "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_VALID_PERFORMANCE_ENTRY_TYPE\"></a></p>",
              "type": "module",
              "displayName": "`ERR_V8BREAKITERATOR`"
            },
            {
              "textRaw": "`ERR_VALID_PERFORMANCE_ENTRY_TYPE`",
              "name": "`err_valid_performance_entry_type`",
              "desc": "<p>While using the Performance Timing API (<code>perf_hooks</code>), no valid performance\nentry types were found.</p>\n<p><a id=\"ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING\"></a></p>",
              "type": "module",
              "displayName": "`ERR_VALID_PERFORMANCE_ENTRY_TYPE`"
            },
            {
              "textRaw": "`ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING`",
              "name": "`err_vm_dynamic_import_callback_missing`",
              "desc": "<p>A dynamic import callback was not specified.</p>\n<p><a id=\"ERR_VM_MODULE_ALREADY_LINKED\"></a></p>",
              "type": "module",
              "displayName": "`ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING`"
            },
            {
              "textRaw": "`ERR_VM_MODULE_ALREADY_LINKED`",
              "name": "`err_vm_module_already_linked`",
              "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>",
              "type": "module",
              "displayName": "`ERR_VM_MODULE_ALREADY_LINKED`"
            },
            {
              "textRaw": "`ERR_VM_MODULE_CACHED_DATA_REJECTED`",
              "name": "`err_vm_module_cached_data_rejected`",
              "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>",
              "type": "module",
              "displayName": "`ERR_VM_MODULE_CACHED_DATA_REJECTED`"
            },
            {
              "textRaw": "`ERR_VM_MODULE_CANNOT_CREATE_CACHED_DATA`",
              "name": "`err_vm_module_cannot_create_cached_data`",
              "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>",
              "type": "module",
              "displayName": "`ERR_VM_MODULE_CANNOT_CREATE_CACHED_DATA`"
            },
            {
              "textRaw": "`ERR_VM_MODULE_DIFFERENT_CONTEXT`",
              "name": "`err_vm_module_different_context`",
              "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_LINKING_ERRORED\"></a></p>",
              "type": "module",
              "displayName": "`ERR_VM_MODULE_DIFFERENT_CONTEXT`"
            },
            {
              "textRaw": "`ERR_VM_MODULE_LINKING_ERRORED`",
              "name": "`err_vm_module_linking_errored`",
              "desc": "<p>The linker function returned a module for which linking has failed.</p>\n<p><a id=\"ERR_VM_MODULE_NOT_MODULE\"></a></p>",
              "type": "module",
              "displayName": "`ERR_VM_MODULE_LINKING_ERRORED`"
            },
            {
              "textRaw": "`ERR_VM_MODULE_NOT_MODULE`",
              "name": "`err_vm_module_not_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>",
              "type": "module",
              "displayName": "`ERR_VM_MODULE_NOT_MODULE`"
            },
            {
              "textRaw": "`ERR_VM_MODULE_STATUS`",
              "name": "`err_vm_module_status`",
              "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>",
              "type": "module",
              "displayName": "`ERR_VM_MODULE_STATUS`"
            },
            {
              "textRaw": "`ERR_WASI_ALREADY_STARTED`",
              "name": "`err_wasi_already_started`",
              "desc": "<p>The WASI instance has already started.</p>\n<p><a id=\"ERR_WASI_NOT_STARTED\"></a></p>",
              "type": "module",
              "displayName": "`ERR_WASI_ALREADY_STARTED`"
            },
            {
              "textRaw": "`ERR_WASI_NOT_STARTED`",
              "name": "`err_wasi_not_started`",
              "desc": "<p>The WASI instance has not been started.</p>\n<p><a id=\"ERR_WORKER_INIT_FAILED\"></a></p>",
              "type": "module",
              "displayName": "`ERR_WASI_NOT_STARTED`"
            },
            {
              "textRaw": "`ERR_WORKER_INIT_FAILED`",
              "name": "`err_worker_init_failed`",
              "desc": "<p>The <code>Worker</code> initialization failed.</p>\n<p><a id=\"ERR_WORKER_INVALID_EXEC_ARGV\"></a></p>",
              "type": "module",
              "displayName": "`ERR_WORKER_INIT_FAILED`"
            },
            {
              "textRaw": "`ERR_WORKER_INVALID_EXEC_ARGV`",
              "name": "`err_worker_invalid_exec_argv`",
              "desc": "<p>The <code>execArgv</code> option passed to the <code>Worker</code> constructor contains\ninvalid flags.</p>\n<p><a id=\"ERR_WORKER_NOT_RUNNING\"></a></p>",
              "type": "module",
              "displayName": "`ERR_WORKER_INVALID_EXEC_ARGV`"
            },
            {
              "textRaw": "`ERR_WORKER_NOT_RUNNING`",
              "name": "`err_worker_not_running`",
              "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>",
              "type": "module",
              "displayName": "`ERR_WORKER_NOT_RUNNING`"
            },
            {
              "textRaw": "`ERR_WORKER_OUT_OF_MEMORY`",
              "name": "`err_worker_out_of_memory`",
              "desc": "<p>The <code>Worker</code> instance terminated because it reached its memory limit.</p>\n<p><a id=\"ERR_WORKER_PATH\"></a></p>",
              "type": "module",
              "displayName": "`ERR_WORKER_OUT_OF_MEMORY`"
            },
            {
              "textRaw": "`ERR_WORKER_PATH`",
              "name": "`err_worker_path`",
              "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>",
              "type": "module",
              "displayName": "`ERR_WORKER_PATH`"
            },
            {
              "textRaw": "`ERR_WORKER_UNSERIALIZABLE_ERROR`",
              "name": "`err_worker_unserializable_error`",
              "desc": "<p>All attempts at serializing an uncaught exception from a worker thread failed.</p>\n<p><a id=\"ERR_WORKER_UNSUPPORTED_EXTENSION\"></a></p>",
              "type": "module",
              "displayName": "`ERR_WORKER_UNSERIALIZABLE_ERROR`"
            },
            {
              "textRaw": "`ERR_WORKER_UNSUPPORTED_EXTENSION`",
              "name": "`err_worker_unsupported_extension`",
              "desc": "<p>The pathname used for the main script of a worker has an\nunknown file extension.</p>\n<p><a id=\"ERR_WORKER_UNSUPPORTED_OPERATION\"></a></p>",
              "type": "module",
              "displayName": "`ERR_WORKER_UNSUPPORTED_EXTENSION`"
            },
            {
              "textRaw": "`ERR_WORKER_UNSUPPORTED_OPERATION`",
              "name": "`err_worker_unsupported_operation`",
              "desc": "<p>The requested functionality is not supported in worker threads.</p>\n<p><a id=\"ERR_ZLIB_INITIALIZATION_FAILED\"></a></p>",
              "type": "module",
              "displayName": "`ERR_WORKER_UNSUPPORTED_OPERATION`"
            },
            {
              "textRaw": "`ERR_ZLIB_INITIALIZATION_FAILED`",
              "name": "`err_zlib_initialization_failed`",
              "desc": "<p>Creation of a <a href=\"zlib.html\"><code>zlib</code></a> object failed due to incorrect configuration.</p>\n<p><a id=\"HPE_HEADER_OVERFLOW\"></a></p>",
              "type": "module",
              "displayName": "`ERR_ZLIB_INITIALIZATION_FAILED`"
            },
            {
              "textRaw": "`HPE_HEADER_OVERFLOW`",
              "name": "`hpe_header_overflow`",
              "meta": {
                "changes": [
                  {
                    "version": "v11.4.0",
                    "pr-url": "https://github.com/nodejs/node/commit/186035243fad247e3955f",
                    "description": "Max header size in `http_parser` was set to 8KB."
                  }
                ]
              },
              "desc": "<p>Too much HTTP header data was received. In order to protect against malicious or\nmalconfigured clients, if more than 8KB 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=\"MODULE_NOT_FOUND\"></a></p>",
              "type": "module",
              "displayName": "`HPE_HEADER_OVERFLOW`"
            },
            {
              "textRaw": "`MODULE_NOT_FOUND`",
              "name": "`module_not_found`",
              "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 while attempting a <a href=\"modules.html#modules_require_id\"><code>require()</code></a> or\n<code>import</code> operation.</p>",
              "type": "module",
              "displayName": "`MODULE_NOT_FOUND`"
            }
          ],
          "type": "misc",
          "displayName": "Node.js error codes"
        },
        {
          "textRaw": "Legacy Node.js error codes",
          "name": "legacy_node.js_error_codes",
          "stability": 0,
          "stabilityText": "Deprecated. These error codes are either inconsistent, or have\nbeen removed.",
          "desc": "<p><a id=\"ERR_CANNOT_TRANSFER_OBJECT\"></a></p>",
          "modules": [
            {
              "textRaw": "`ERR_CANNOT_TRANSFER_OBJECT`",
              "name": "`err_cannot_transfer_object`",
              "desc": "<!--\nadded: v10.5.0\nremoved: v12.5.0\n-->\n<p>The value passed to <code>postMessage()</code> contained an object that is not supported\nfor transferring.</p>\n<p><a id=\"ERR_CLOSED_MESSAGE_PORT\"></a></p>",
              "type": "module",
              "displayName": "`ERR_CANNOT_TRANSFER_OBJECT`"
            },
            {
              "textRaw": "`ERR_CLOSED_MESSAGE_PORT`",
              "name": "`err_closed_message_port`",
              "meta": {
                "added": [
                  "v10.5.0"
                ],
                "removed": [
                  "v11.12.0"
                ],
                "changes": []
              },
              "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_CRYPTO_HASH_DIGEST_NO_UTF16\"></a></p>",
              "type": "module",
              "displayName": "`ERR_CLOSED_MESSAGE_PORT`"
            },
            {
              "textRaw": "`ERR_CRYPTO_HASH_DIGEST_NO_UTF16`",
              "name": "`err_crypto_hash_digest_no_utf16`",
              "meta": {
                "added": [
                  "v9.0.0"
                ],
                "removed": [
                  "v12.12.0"
                ],
                "changes": []
              },
              "desc": "<p>The UTF-16 encoding was used with <a href=\"crypto.html#crypto_hash_digest_encoding\"><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_HTTP2_FRAME_ERROR\"></a></p>",
              "type": "module",
              "displayName": "`ERR_CRYPTO_HASH_DIGEST_NO_UTF16`"
            },
            {
              "textRaw": "`ERR_HTTP2_FRAME_ERROR`",
              "name": "`err_http2_frame_error`",
              "meta": {
                "added": [
                  "v9.0.0"
                ],
                "removed": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "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>",
              "type": "module",
              "displayName": "`ERR_HTTP2_FRAME_ERROR`"
            },
            {
              "textRaw": "`ERR_HTTP2_HEADERS_OBJECT`",
              "name": "`err_http2_headers_object`",
              "meta": {
                "added": [
                  "v9.0.0"
                ],
                "removed": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "desc": "<p>Used when an HTTP/2 Headers Object is expected.</p>\n<p><a id=\"ERR_HTTP2_HEADER_REQUIRED\"></a></p>",
              "type": "module",
              "displayName": "`ERR_HTTP2_HEADERS_OBJECT`"
            },
            {
              "textRaw": "`ERR_HTTP2_HEADER_REQUIRED`",
              "name": "`err_http2_header_required`",
              "meta": {
                "added": [
                  "v9.0.0"
                ],
                "removed": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "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>",
              "type": "module",
              "displayName": "`ERR_HTTP2_HEADER_REQUIRED`"
            },
            {
              "textRaw": "`ERR_HTTP2_INFO_HEADERS_AFTER_RESPOND`",
              "name": "`err_http2_info_headers_after_respond`",
              "meta": {
                "added": [
                  "v9.0.0"
                ],
                "removed": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "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>",
              "type": "module",
              "displayName": "`ERR_HTTP2_INFO_HEADERS_AFTER_RESPOND`"
            },
            {
              "textRaw": "`ERR_HTTP2_STREAM_CLOSED`",
              "name": "`err_http2_stream_closed`",
              "meta": {
                "added": [
                  "v9.0.0"
                ],
                "removed": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "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>",
              "type": "module",
              "displayName": "`ERR_HTTP2_STREAM_CLOSED`"
            },
            {
              "textRaw": "`ERR_HTTP_INVALID_CHAR`",
              "name": "`err_http_invalid_char`",
              "meta": {
                "added": [
                  "v9.0.0"
                ],
                "removed": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "desc": "<p>Used when an invalid character is found in an HTTP response status message\n(reason phrase).</p>\n<p><a id=\"ERR_INDEX_OUT_OF_RANGE\"></a></p>",
              "type": "module",
              "displayName": "`ERR_HTTP_INVALID_CHAR`"
            },
            {
              "textRaw": "`ERR_INDEX_OUT_OF_RANGE`",
              "name": "`err_index_out_of_range`",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "removed": [
                  "v11.0.0"
                ],
                "changes": []
              },
              "desc": "<p>A given index was out of the accepted range (e.g. negative offsets).</p>\n<p><a id=\"ERR_NAPI_CONS_PROTOTYPE_OBJECT\"></a></p>",
              "type": "module",
              "displayName": "`ERR_INDEX_OUT_OF_RANGE`"
            },
            {
              "textRaw": "`ERR_NAPI_CONS_PROTOTYPE_OBJECT`",
              "name": "`err_napi_cons_prototype_object`",
              "meta": {
                "added": [
                  "v9.0.0"
                ],
                "removed": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "desc": "<p>Used by the <code>N-API</code> when <code>Constructor.prototype</code> is not an object.</p>\n<p><a id=\"ERR_NO_LONGER_SUPPORTED\"></a></p>",
              "type": "module",
              "displayName": "`ERR_NAPI_CONS_PROTOTYPE_OBJECT`"
            },
            {
              "textRaw": "`ERR_NO_LONGER_SUPPORTED`",
              "name": "`err_no_longer_supported`",
              "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>",
              "type": "module",
              "displayName": "`ERR_NO_LONGER_SUPPORTED`"
            },
            {
              "textRaw": "`ERR_OUTOFMEMORY`",
              "name": "`err_outofmemory`",
              "meta": {
                "added": [
                  "v9.0.0"
                ],
                "removed": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "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>",
              "type": "module",
              "displayName": "`ERR_OUTOFMEMORY`"
            },
            {
              "textRaw": "`ERR_PARSE_HISTORY_DATA`",
              "name": "`err_parse_history_data`",
              "meta": {
                "added": [
                  "v9.0.0"
                ],
                "removed": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "desc": "<p>The <code>repl</code> module was unable to parse data from the REPL history file.</p>\n<p><a id=\"ERR_STDERR_CLOSE\"></a></p>",
              "type": "module",
              "displayName": "`ERR_PARSE_HISTORY_DATA`"
            },
            {
              "textRaw": "`ERR_STDERR_CLOSE`",
              "name": "`err_stderr_close`",
              "meta": {
                "removed": [
                  "v10.12.0"
                ],
                "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."
                  }
                ]
              },
              "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>",
              "type": "module",
              "displayName": "`ERR_STDERR_CLOSE`"
            },
            {
              "textRaw": "`ERR_STDOUT_CLOSE`",
              "name": "`err_stdout_close`",
              "meta": {
                "removed": [
                  "v10.12.0"
                ],
                "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."
                  }
                ]
              },
              "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>",
              "type": "module",
              "displayName": "`ERR_STDOUT_CLOSE`"
            },
            {
              "textRaw": "`ERR_STREAM_READ_NOT_IMPLEMENTED`",
              "name": "`err_stream_read_not_implemented`",
              "meta": {
                "added": [
                  "v9.0.0"
                ],
                "removed": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "desc": "<p>Used when an attempt is made to use a readable stream that has not implemented\n<a href=\"stream.html#stream_readable_read_size_1\"><code>readable._read()</code></a>.</p>\n<p><a id=\"ERR_TLS_RENEGOTIATION_FAILED\"></a></p>",
              "type": "module",
              "displayName": "`ERR_STREAM_READ_NOT_IMPLEMENTED`"
            },
            {
              "textRaw": "`ERR_TLS_RENEGOTIATION_FAILED`",
              "name": "`err_tls_renegotiation_failed`",
              "meta": {
                "added": [
                  "v9.0.0"
                ],
                "removed": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "desc": "<p>Used when a TLS renegotiation request has failed in a non-specific way.</p>\n<p><a id=\"ERR_UNKNOWN_BUILTIN_MODULE\"></a></p>",
              "type": "module",
              "displayName": "`ERR_TLS_RENEGOTIATION_FAILED`"
            },
            {
              "textRaw": "`ERR_UNKNOWN_BUILTIN_MODULE`",
              "name": "`err_unknown_builtin_module`",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "removed": [
                  "v9.0.0"
                ],
                "changes": []
              },
              "desc": "<p>The <code>'ERR_UNKNOWN_BUILTIN_MODULE'</code> error code is used to identify a specific\nkind of internal Node.js error that should not typically be triggered by user\ncode. Instances of this error point to an internal bug within the Node.js\nbinary itself.</p>\n<p><a id=\"ERR_UNKNOWN_STDIN_TYPE\"></a></p>",
              "type": "module",
              "displayName": "`ERR_UNKNOWN_BUILTIN_MODULE`"
            },
            {
              "textRaw": "`ERR_UNKNOWN_STDIN_TYPE`",
              "name": "`err_unknown_stdin_type`",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "removed": [
                  "v11.7.0"
                ],
                "changes": []
              },
              "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>",
              "type": "module",
              "displayName": "`ERR_UNKNOWN_STDIN_TYPE`"
            },
            {
              "textRaw": "`ERR_UNKNOWN_STREAM_TYPE`",
              "name": "`err_unknown_stream_type`",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "removed": [
                  "v11.7.0"
                ],
                "changes": []
              },
              "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_VALUE_OUT_OF_RANGE\"></a></p>",
              "type": "module",
              "displayName": "`ERR_UNKNOWN_STREAM_TYPE`"
            },
            {
              "textRaw": "`ERR_VALUE_OUT_OF_RANGE`",
              "name": "`err_value_out_of_range`",
              "meta": {
                "added": [
                  "v9.0.0"
                ],
                "removed": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "desc": "<p>Used when a given value is out of the accepted range.</p>\n<p><a id=\"ERR_VM_MODULE_NOT_LINKED\"></a></p>",
              "type": "module",
              "displayName": "`ERR_VALUE_OUT_OF_RANGE`"
            },
            {
              "textRaw": "`ERR_VM_MODULE_NOT_LINKED`",
              "name": "`err_vm_module_not_linked`",
              "desc": "<p>The module must be successfully linked before instantiation.</p>\n<p><a id=\"ERR_ZLIB_BINDING_CLOSED\"></a></p>",
              "type": "module",
              "displayName": "`ERR_VM_MODULE_NOT_LINKED`"
            },
            {
              "textRaw": "`ERR_ZLIB_BINDING_CLOSED`",
              "name": "`err_zlib_binding_closed`",
              "meta": {
                "added": [
                  "v9.0.0"
                ],
                "removed": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "desc": "<p>Used when an attempt is made to use a <code>zlib</code> object after it has already been\nclosed.</p>",
              "type": "module",
              "displayName": "`ERR_ZLIB_BINDING_CLOSED`"
            },
            {
              "textRaw": "Other error codes",
              "name": "other_error_codes",
              "desc": "<p>These errors have never been released, but had been present on master between\nreleases.</p>\n<p><a id=\"ERR_ENTRY_TYPE_MISMATCH\"></a></p>",
              "modules": [
                {
                  "textRaw": "`ERR_ENTRY_TYPE_MISMATCH`",
                  "name": "`err_entry_type_mismatch`",
                  "stability": 1,
                  "stabilityText": "Experimental",
                  "desc": "<p>The <code>--entry-type=commonjs</code> flag was used to attempt to execute an <code>.mjs</code> file\nor a <code>.js</code> file where the nearest parent <code>package.json</code> contains\n<code>\"type\": \"module\"</code>; or\nthe <code>--entry-type=module</code> flag was used to attempt to execute a <code>.cjs</code> file or\na <code>.js</code> file where the nearest parent <code>package.json</code> either lacks a <code>\"type\"</code>\nfield or contains <code>\"type\": \"commonjs\"</code>.</p>\n<p><a id=\"ERR_FS_WATCHER_ALREADY_STARTED\"></a></p>",
                  "type": "module",
                  "displayName": "`ERR_ENTRY_TYPE_MISMATCH`"
                },
                {
                  "textRaw": "`ERR_FS_WATCHER_ALREADY_STARTED`",
                  "name": "`err_fs_watcher_already_started`",
                  "desc": "<p>An attempt was made to start a watcher returned by <code>fs.watch()</code> that has\nalready been started.</p>\n<p><a id=\"ERR_FS_WATCHER_NOT_STARTED\"></a></p>",
                  "type": "module",
                  "displayName": "`ERR_FS_WATCHER_ALREADY_STARTED`"
                },
                {
                  "textRaw": "`ERR_FS_WATCHER_NOT_STARTED`",
                  "name": "`err_fs_watcher_not_started`",
                  "desc": "<p>An attempt was made to initiate operations on a watcher returned by\n<code>fs.watch()</code> that has not yet been started.</p>\n<p><a id=\"ERR_HTTP2_ALREADY_SHUTDOWN\"></a></p>",
                  "type": "module",
                  "displayName": "`ERR_FS_WATCHER_NOT_STARTED`"
                },
                {
                  "textRaw": "`ERR_HTTP2_ALREADY_SHUTDOWN`",
                  "name": "`err_http2_already_shutdown`",
                  "desc": "<p>Occurs with multiple attempts to shutdown an HTTP/2 session.</p>\n<p><a id=\"ERR_HTTP2_ERROR\"></a></p>",
                  "type": "module",
                  "displayName": "`ERR_HTTP2_ALREADY_SHUTDOWN`"
                },
                {
                  "textRaw": "`ERR_HTTP2_ERROR`",
                  "name": "`err_http2_error`",
                  "desc": "<p>A non-specific HTTP/2 error has occurred.</p>\n<p><a id=\"ERR_INVALID_REPL_HISTORY\"></a></p>",
                  "type": "module",
                  "displayName": "`ERR_HTTP2_ERROR`"
                },
                {
                  "textRaw": "`ERR_INVALID_REPL_HISTORY`",
                  "name": "`err_invalid_repl_history`",
                  "desc": "<p>Used in the <code>repl</code> in case the old history file is used and an error occurred\nwhile trying to read and parse it.</p>\n<p><a id=\"ERR_INVALID_REPL_TYPE\"></a></p>",
                  "type": "module",
                  "displayName": "`ERR_INVALID_REPL_HISTORY`"
                },
                {
                  "textRaw": "`ERR_INVALID_REPL_TYPE`",
                  "name": "`err_invalid_repl_type`",
                  "stability": 1,
                  "stabilityText": "Experimental",
                  "desc": "<p>The <code>--entry-type=...</code> flag is not compatible with the Node.js REPL.</p>\n<p><a id=\"ERR_MISSING_DYNAMIC_INSTANTIATE_HOOK\"></a></p>",
                  "type": "module",
                  "displayName": "`ERR_INVALID_REPL_TYPE`"
                },
                {
                  "textRaw": "`ERR_MISSING_DYNAMIC_INSTANTIATE_HOOK`",
                  "name": "`err_missing_dynamic_instantiate_hook`",
                  "desc": "<p>Used when an <a href=\"esm.html\">ES Module</a> loader hook specifies <code>format: 'dynamic'</code> but does\nnot provide a <code>dynamicInstantiate</code> hook.</p>\n<p><a id=\"ERR_STREAM_HAS_STRINGDECODER\"></a></p>",
                  "type": "module",
                  "displayName": "`ERR_MISSING_DYNAMIC_INSTANTIATE_HOOK`"
                },
                {
                  "textRaw": "`ERR_STREAM_HAS_STRINGDECODER`",
                  "name": "`err_stream_has_stringdecoder`",
                  "desc": "<p>Used to prevent an abort if a string decoder was set on the Socket.</p>\n<pre><code class=\"language-js\">const Socket = require('net').Socket;\nconst instance = new Socket();\n\ninstance.setEncoding('utf8');\n</code></pre>\n<p><a id=\"ERR_STRING_TOO_LARGE\"></a></p>",
                  "type": "module",
                  "displayName": "`ERR_STREAM_HAS_STRINGDECODER`"
                },
                {
                  "textRaw": "`ERR_STRING_TOO_LARGE`",
                  "name": "`err_string_too_large`",
                  "desc": "<p>An attempt has been made to create a string larger than the maximum allowed\nsize.</p>\n<p><a id=\"ERR_TTY_WRITABLE_NOT_READABLE\"></a></p>",
                  "type": "module",
                  "displayName": "`ERR_STRING_TOO_LARGE`"
                },
                {
                  "textRaw": "`ERR_TTY_WRITABLE_NOT_READABLE`",
                  "name": "`err_tty_writable_not_readable`",
                  "desc": "<p>This <code>Error</code> is thrown when a read is attempted on a TTY <code>WriteStream</code>,\nsuch as <code>process.stdout.on('data')</code>.</p>",
                  "type": "module",
                  "displayName": "`ERR_TTY_WRITABLE_NOT_READABLE`"
                }
              ],
              "type": "module",
              "displayName": "Other error codes"
            }
          ],
          "type": "misc",
          "displayName": "Legacy Node.js error codes"
        }
      ],
      "classes": [
        {
          "textRaw": "Class: `Error`",
          "type": "class",
          "name": "Error",
          "desc": "<p>A generic JavaScript <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error\" class=\"type\">&lt;Error&gt;</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>",
          "methods": [
            {
              "textRaw": "`Error.captureStackTrace(targetObject[, constructorOpt])`",
              "type": "method",
              "name": "captureStackTrace",
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`targetObject` {Object}",
                      "name": "targetObject",
                      "type": "Object"
                    },
                    {
                      "textRaw": "`constructorOpt` {Function}",
                      "name": "constructorOpt",
                      "type": "Function"
                    }
                  ]
                }
              ],
              "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 an end user. For instance:</p>\n<pre><code class=\"language-js\">function MyError() {\n  Error.captureStackTrace(this, MyError);\n}\n\n// Without passing MyError to captureStackTrace, the MyError\n// frame would show up in the .stack property. By passing\n// the constructor, we omit that frame, and retain all frames below it.\nnew MyError().stack;\n</code></pre>"
            }
          ],
          "properties": [
            {
              "textRaw": "`stackTraceLimit` {number}",
              "type": "number",
              "name": "stackTraceLimit",
              "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": "`code` {string}",
              "type": "string",
              "name": "code",
              "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=\"errors.html#nodejs-error-codes\">Node.js error codes</a> for details\nabout specific codes.</p>"
            },
            {
              "textRaw": "`message` {string}",
              "type": "string",
              "name": "message",
              "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": "`stack` {string}",
              "type": "string",
              "name": "stack",
              "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, or its dependencies.</li>\n</ul>\n<p>The string representing the stack trace is lazily generated when the\n<code>error.stack</code> property is <strong>accessed</strong>.</p>\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>"
            }
          ],
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`message` {string}",
                  "name": "message",
                  "type": "string"
                }
              ],
              "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>message.toString()</code>. 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://github.com/v8/v8/wiki/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>"
            }
          ]
        },
        {
          "textRaw": "Class: `AssertionError`",
          "type": "class",
          "name": "AssertionError",
          "desc": "<ul>\n<li>Extends: <a href=\"errors.html#errors_class_error\" class=\"type\">&lt;errors.Error&gt;</a></li>\n</ul>\n<p>Indicates the failure of an assertion. For details, see\n<a href=\"assert.html#assert_class_assert_assertionerror\"><code>Class: assert.AssertionError</code></a>.</p>"
        },
        {
          "textRaw": "Class: `RangeError`",
          "type": "class",
          "name": "RangeError",
          "desc": "<ul>\n<li>Extends: <a href=\"errors.html#errors_class_error\" class=\"type\">&lt;errors.Error&gt;</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('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`",
          "type": "class",
          "name": "ReferenceError",
          "desc": "<ul>\n<li>Extends: <a href=\"errors.html#errors_class_error\" class=\"type\">&lt;errors.Error&gt;</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 should always be considered a bug in the code\nor its dependencies.</p>"
        },
        {
          "textRaw": "Class: `SyntaxError`",
          "type": "class",
          "name": "SyntaxError",
          "desc": "<ul>\n<li>Extends: <a href=\"errors.html#errors_class_error\" class=\"type\">&lt;errors.Error&gt;</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('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`",
          "type": "class",
          "name": "SystemError",
          "desc": "<ul>\n<li>Extends: <a href=\"errors.html#errors_class_error\" class=\"type\">&lt;errors.Error&gt;</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/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string&gt;</a> If present, the address to which a network connection\nfailed</li>\n<li><code>code</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string&gt;</a> The string error code</li>\n<li><code>dest</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string&gt;</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/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;number&gt;</a> | <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string&gt;</a> The system-provided error number</li>\n<li><code>info</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object\" class=\"type\">&lt;Object&gt;</a> If present, extra details about the error condition</li>\n<li><code>message</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string&gt;</a> A system-provided human-readable description of the error</li>\n<li><code>path</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string&gt;</a> If present, the file path when reporting a file system error</li>\n<li><code>port</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;number&gt;</a> If present, the network connection port that is not available</li>\n<li><code>syscall</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string&gt;</a> The name of the system call that triggered the error</li>\n</ul>",
          "properties": [
            {
              "textRaw": "`address` {string}",
              "type": "string",
              "name": "address",
              "desc": "<p>If present, <code>error.address</code> is a string describing the address to which a\nnetwork connection failed.</p>"
            },
            {
              "textRaw": "`code` {string}",
              "type": "string",
              "name": "code",
              "desc": "<p>The <code>error.code</code> property is a string representing the error code.</p>"
            },
            {
              "textRaw": "`dest` {string}",
              "type": "string",
              "name": "dest",
              "desc": "<p>If present, <code>error.dest</code> is the file path destination when reporting a file\nsystem error.</p>"
            },
            {
              "textRaw": "`errno` {string|number}",
              "type": "string|number",
              "name": "errno",
              "desc": "<p>The <code>error.errno</code> property is a number or a string. If it is a number, it is a\nnegative value which corresponds to the error code defined in\n<a href=\"http://docs.libuv.org/en/v1.x/errors.html\"><code>libuv Error handling</code></a>. See the libuv <code>errno.h</code> header file\n(<code>deps/uv/include/uv/errno.h</code> in the Node.js source tree) for details. In case\nof a string, it is the same as <code>error.code</code>.</p>"
            },
            {
              "textRaw": "`info` {Object}",
              "type": "Object",
              "name": "info",
              "desc": "<p>If present, <code>error.info</code> is an object with details about the error condition.</p>"
            },
            {
              "textRaw": "`message` {string}",
              "type": "string",
              "name": "message",
              "desc": "<p><code>error.message</code> is a system-provided human-readable description of the error.</p>"
            },
            {
              "textRaw": "`path` {string}",
              "type": "string",
              "name": "path",
              "desc": "<p>If present, <code>error.path</code> is a string containing a relevant invalid pathname.</p>"
            },
            {
              "textRaw": "`port` {number}",
              "type": "number",
              "name": "port",
              "desc": "<p>If present, <code>error.port</code> is the network connection port that is not available.</p>"
            },
            {
              "textRaw": "`syscall` {string}",
              "type": "string",
              "name": "syscall",
              "desc": "<p>The <code>error.syscall</code> property is a string describing the <a href=\"http://man7.org/linux/man-pages/man2/syscalls.2.html\">syscall</a> that failed.</p>"
            }
          ],
          "modules": [
            {
              "textRaw": "Common system errors",
              "name": "common_system_errors",
              "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=\"http://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#fs_fs_readdir_path_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#fs_fs_unlink_path_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>",
              "type": "module",
              "displayName": "Common system errors"
            }
          ]
        },
        {
          "textRaw": "Class: `TypeError`",
          "type": "class",
          "name": "TypeError",
          "desc": "<ul>\n<li>Extends <a href=\"errors.html#errors_class_error\" class=\"type\">&lt;errors.Error&gt;</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 considered\na <code>TypeError</code>.</p>\n<pre><code class=\"language-js\">require('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>"
        }
      ]
    },
    {
      "textRaw": "Global objects",
      "name": "Global objects",
      "introduced_in": "v0.10.0",
      "type": "misc",
      "desc": "<p>These objects are available in all modules. The following variables may appear\nto be global but are not. They exist only in the scope of modules, see the\n<a href=\"modules.html\">module system documentation</a>:</p>\n<ul>\n<li><a href=\"modules.html#modules_dirname\"><code>__dirname</code></a></li>\n<li><a href=\"modules.html#modules_filename\"><code>__filename</code></a></li>\n<li><a href=\"modules.html#modules_exports\"><code>exports</code></a></li>\n<li><a href=\"modules.html#modules_module\"><code>module</code></a></li>\n<li><a href=\"modules.html#modules_require_id\"><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>",
      "globals": [
        {
          "textRaw": "Class: `Buffer`",
          "type": "global",
          "name": "Buffer",
          "meta": {
            "added": [
              "v0.1.103"
            ],
            "changes": []
          },
          "desc": "<ul>\n<li><a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function\" class=\"type\">&lt;Function&gt;</a></li>\n</ul>\n<p>Used to handle binary data. See the <a href=\"buffer.html\">buffer section</a>.</p>"
        },
        {
          "textRaw": "`clearImmediate(immediateObject)`",
          "type": "global",
          "name": "clearImmediate",
          "meta": {
            "added": [
              "v0.9.1"
            ],
            "changes": []
          },
          "desc": "<p><a href=\"timers.html#timers_clearimmediate_immediate\"><code>clearImmediate</code></a> is described in the <a href=\"timers.html\">timers</a> section.</p>"
        },
        {
          "textRaw": "`clearInterval(intervalObject)`",
          "type": "global",
          "name": "clearInterval",
          "meta": {
            "added": [
              "v0.0.1"
            ],
            "changes": []
          },
          "desc": "<p><a href=\"timers.html#timers_clearinterval_timeout\"><code>clearInterval</code></a> is described in the <a href=\"timers.html\">timers</a> section.</p>"
        },
        {
          "textRaw": "`clearTimeout(timeoutObject)`",
          "type": "global",
          "name": "clearTimeout",
          "meta": {
            "added": [
              "v0.0.1"
            ],
            "changes": []
          },
          "desc": "<p><a href=\"timers.html#timers_cleartimeout_timeout\"><code>clearTimeout</code></a> is described in the <a href=\"timers.html\">timers</a> section.</p>"
        },
        {
          "textRaw": "`console`",
          "name": "`console`",
          "meta": {
            "added": [
              "v0.1.100"
            ],
            "changes": []
          },
          "type": "global",
          "desc": "<ul>\n<li><a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object\" class=\"type\">&lt;Object&gt;</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>"
        },
        {
          "textRaw": "`global`",
          "name": "`global`",
          "meta": {
            "added": [
              "v0.1.27"
            ],
            "changes": []
          },
          "type": "global",
          "desc": "<ul>\n<li><a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object\" class=\"type\">&lt;Object&gt;</a> The global namespace object.</li>\n</ul>\n<p>In browsers, the top-level scope is the global scope. This means that\nwithin the browser <code>var something</code> will define a new global variable. In\nNode.js this is different. The top-level scope is not the global scope;\n<code>var something</code> inside a Node.js module will be local to that module.</p>"
        },
        {
          "textRaw": "`process`",
          "name": "`process`",
          "meta": {
            "added": [
              "v0.1.7"
            ],
            "changes": []
          },
          "type": "global",
          "desc": "<ul>\n<li><a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object\" class=\"type\">&lt;Object&gt;</a></li>\n</ul>\n<p>The process object. See the <a href=\"process.html#process_process\"><code>process</code> object</a> section.</p>"
        },
        {
          "textRaw": "`queueMicrotask(callback)`",
          "type": "global",
          "name": "queueMicrotask",
          "meta": {
            "added": [
              "v11.0.0"
            ],
            "changes": []
          },
          "desc": "<ul>\n<li><code>callback</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function\" class=\"type\">&lt;Function&gt;</a> Function to be queued.</li>\n</ul>\n<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_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#process_process_nexttick_callback_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(url);\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(url, data);\n  this.emit('load', data);\n};\n</code></pre>"
        },
        {
          "textRaw": "`setImmediate(callback[, ...args])`",
          "type": "global",
          "name": "setImmediate",
          "meta": {
            "added": [
              "v0.9.1"
            ],
            "changes": []
          },
          "desc": "<p><a href=\"timers.html#timers_setimmediate_callback_args\"><code>setImmediate</code></a> is described in the <a href=\"timers.html\">timers</a> section.</p>"
        },
        {
          "textRaw": "`setInterval(callback, delay[, ...args])`",
          "type": "global",
          "name": "setInterval",
          "meta": {
            "added": [
              "v0.0.1"
            ],
            "changes": []
          },
          "desc": "<p><a href=\"timers.html#timers_setinterval_callback_delay_args\"><code>setInterval</code></a> is described in the <a href=\"timers.html\">timers</a> section.</p>"
        },
        {
          "textRaw": "`setTimeout(callback, delay[, ...args])`",
          "type": "global",
          "name": "setTimeout",
          "meta": {
            "added": [
              "v0.0.1"
            ],
            "changes": []
          },
          "desc": "<p><a href=\"timers.html#timers_settimeout_callback_delay_args\"><code>setTimeout</code></a> is described in the <a href=\"timers.html\">timers</a> section.</p>"
        },
        {
          "textRaw": "`TextDecoder`",
          "name": "`TextDecoder`",
          "meta": {
            "added": [
              "v11.0.0"
            ],
            "changes": []
          },
          "type": "global",
          "desc": "<p>The WHATWG <code>TextDecoder</code> class. See the <a href=\"util.html#util_class_util_textdecoder\"><code>TextDecoder</code></a> section.</p>"
        },
        {
          "textRaw": "`TextEncoder`",
          "name": "`TextEncoder`",
          "meta": {
            "added": [
              "v11.0.0"
            ],
            "changes": []
          },
          "type": "global",
          "desc": "<p>The WHATWG <code>TextEncoder</code> class. See the <a href=\"util.html#util_class_util_textencoder\"><code>TextEncoder</code></a> section.</p>"
        },
        {
          "textRaw": "`URL`",
          "name": "`URL`",
          "meta": {
            "added": [
              "v10.0.0"
            ],
            "changes": []
          },
          "type": "global",
          "desc": "<p>The WHATWG <code>URL</code> class. See the <a href=\"url.html#url_class_url\"><code>URL</code></a> section.</p>"
        },
        {
          "textRaw": "`URLSearchParams`",
          "name": "`URLSearchParams`",
          "meta": {
            "added": [
              "v10.0.0"
            ],
            "changes": []
          },
          "type": "global",
          "desc": "<p>The WHATWG <code>URLSearchParams</code> class. See the <a href=\"url.html#url_class_urlsearchparams\"><code>URLSearchParams</code></a> section.</p>"
        },
        {
          "textRaw": "`WebAssembly`",
          "name": "`WebAssembly`",
          "meta": {
            "added": [
              "v8.0.0"
            ],
            "changes": []
          },
          "type": "global",
          "desc": "<ul>\n<li><a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object\" class=\"type\">&lt;Object&gt;</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>"
        }
      ],
      "miscs": [
        {
          "textRaw": "`__dirname`",
          "name": "`__dirname`",
          "desc": "<p>This variable may appear to be global but is not. See <a href=\"modules.html#modules_dirname\"><code>__dirname</code></a>.</p>",
          "type": "misc",
          "displayName": "`__dirname`"
        },
        {
          "textRaw": "`__filename`",
          "name": "`__filename`",
          "desc": "<p>This variable may appear to be global but is not. See <a href=\"modules.html#modules_filename\"><code>__filename</code></a>.</p>",
          "type": "misc",
          "displayName": "`__filename`"
        },
        {
          "textRaw": "`exports`",
          "name": "`exports`",
          "desc": "<p>This variable may appear to be global but is not. See <a href=\"modules.html#modules_exports\"><code>exports</code></a>.</p>",
          "type": "misc",
          "displayName": "`exports`"
        },
        {
          "textRaw": "`module`",
          "name": "`module`",
          "desc": "<p>This variable may appear to be global but is not. See <a href=\"modules.html#modules_module\"><code>module</code></a>.</p>",
          "type": "misc",
          "displayName": "`module`"
        }
      ],
      "methods": [
        {
          "textRaw": "`require()`",
          "type": "method",
          "name": "require",
          "signatures": [
            {
              "params": []
            }
          ],
          "desc": "<p>This variable may appear to be global but is not. See <a href=\"modules.html#modules_require_id\"><code>require()</code></a>.</p>"
        }
      ]
    },
    {
      "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>\n<p>Locale-sensitive or Unicode-aware functions in the <a href=\"https://tc39.github.io/ecma262/\">ECMAScript Language\nSpecification</a>:</p>\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>\n<p>All functionality described in the <a href=\"https://tc39.github.io/ecma402/\">ECMAScript Internationalization API\nSpecification</a> (aka ECMA-402):</p>\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#url_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#buffer_buffer_transcode_source_fromenc_toenc\"><code>require('buffer').transcode()</code></a></li>\n<li>More accurate <a href=\"repl.html#repl_repl\">REPL</a> line editing</li>\n<li><a href=\"util.html#util_class_util_textdecoder\"><code>require('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 its underlying V8 engine) uses <a href=\"http://site.icu-project.org/\">ICU</a> to implement these features\nin native C/C++ code. However, some of them require a very large ICU data file\nin order to support all locales of the world. Because it is expected that most\nNode.js users will make use of only a small portion of ICU functionality, only\na subset of the full ICU data set is provided by Node.js by default. Several\noptions are provided for customizing and expanding 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",
          "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/master/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> (default)</li>\n<li><code>--with-intl=full-icu</code></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></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#url_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#buffer_buffer_transcode_source_fromenc_toenc\"><code>require('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\">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#util_class_util_textdecoder\"><code>require('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`)",
              "desc": "<p>If this option is chosen, most internationalization features mentioned above\nwill be <strong>unavailable</strong> in the resulting <code>node</code> binary.</p>",
              "type": "module",
              "displayName": "Disable all internationalization features (`none`)"
            },
            {
              "textRaw": "Build with a pre-installed ICU (`system-icu`)",
              "name": "build_with_a_pre-installed_icu_(`system-icu`)",
              "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#url_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/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>",
              "type": "module",
              "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`)",
              "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#url_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/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 \"M01\" on small-icu\n// Should print \"enero\"\n</code></pre>\n<p>This mode provides a good balance between features and binary size, and it is\nthe default behavior if no <code>--with-intl</code> flag is passed. The official binaries\nare also built in this mode.</p>",
              "modules": [
                {
                  "textRaw": "Providing ICU data at runtime",
                  "name": "providing_icu_data_at_runtime",
                  "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>/some/directory</code>, it can be made available to ICU\nthrough either:</p>\n<ul>\n<li>\n<p>The <a href=\"cli.html#cli_node_icu_data_file\"><code>NODE_ICU_DATA</code></a> environment variable:</p>\n<pre><code class=\"language-bash\">env NODE_ICU_DATA=/some/directory node\n</code></pre>\n</li>\n<li>\n<p>The <a href=\"cli.html#cli_icu_data_dir_file\"><code>--icu-data-dir</code></a> CLI parameter:</p>\n<pre><code class=\"language-bash\">node --icu-data-dir=/some/directory\n</code></pre>\n</li>\n</ul>\n<p>(If both are specified, the <code>--icu-data-dir</code> CLI parameter takes precedence.)</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>icudt6X[bl].dat</code>, where <code>6X</code> denotes\nthe intended ICU version, and <code>b</code> or <code>l</code> indicates the system's endianness.\nCheck <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>",
                  "type": "module",
                  "displayName": "Providing ICU data at runtime"
                }
              ],
              "type": "module",
              "displayName": "Embed a limited set of ICU data (`small-icu`)"
            },
            {
              "textRaw": "Embed the entire ICU (`full-icu`)",
              "name": "embed_the_entire_icu_(`full-icu`)",
              "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. See\n<a href=\"https://github.com/nodejs/node/blob/master/BUILDING.md#build-with-full-icu-support-all-locales-supported-by-icu\">BUILDING.md</a> on how to compile a binary using this mode.</p>",
              "type": "module",
              "displayName": "Embed the entire ICU (`full-icu`)"
            }
          ],
          "type": "misc",
          "displayName": "Options for building Node.js"
        },
        {
          "textRaw": "Detecting internationalization support",
          "name": "detecting_internationalization_support",
          "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/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/master/test/intl402\">Test262</a>: ECMAScript's official conformance test suite includes a section\ndedicated to ECMA-402.</li>\n</ul>",
          "type": "misc",
          "displayName": "Detecting internationalization support"
        }
      ]
    },
    {
      "textRaw": "Policies",
      "name": "policy",
      "introduced_in": "v11.8.0",
      "type": "misc",
      "stability": 1,
      "stabilityText": "Experimental",
      "desc": "<p>Node.js contains experimental support for creating policies on loading code.</p>\n<p>Policies are a security feature intended to allow guarantees\nabout what code Node.js is able to load. The use of policies assumes\nsafe practices for the policy files such as ensuring that policy\nfiles cannot be overwritten by the Node.js application by using\nfile permissions.</p>\n<p>A best practice would be to ensure that the policy manifest is read only for\nthe running Node.js application, and that the file cannot be changed\nby the running Node.js application in any way. A typical setup would be to\ncreate the policy file as a different user id than the one running Node.js\nand granting read permissions to the user id running Node.js.</p>",
      "miscs": [
        {
          "textRaw": "Enabling",
          "name": "Enabling",
          "type": "misc",
          "desc": "<p>The <code>--experimental-policy</code> flag can be used to enable features for policies\nwhen loading modules.</p>\n<p>Once this has been set, all modules must conform to a policy manifest file\npassed to the flag:</p>\n<pre><code class=\"language-bash\">node --experimental-policy=policy.json app.js\n</code></pre>\n<p>The policy manifest will be used to enforce constraints on code loaded by\nNode.js.</p>\n<p>To mitigate tampering with policy files on disk, an integrity for\nthe policy file itself may be provided via <code>--policy-integrity</code>.\nThis allows running <code>node</code> and asserting the policy file contents\neven if the file is changed on disk.</p>\n<pre><code class=\"language-bash\">node --experimental-policy=policy.json --policy-integrity=\"sha384-SggXRQHwCG8g+DktYYzxkXRIkTiEYWBHqev0xnpCxYlqMBufKZHAHQM3/boDaI/0\" app.js\n</code></pre>"
        },
        {
          "textRaw": "Features",
          "name": "features",
          "modules": [
            {
              "textRaw": "Error behavior",
              "name": "error_behavior",
              "desc": "<p>When a policy check fails, Node.js by default will throw an error.\nIt is possible to change the error behavior to one of a few possibilities\nby defining an \"onerror\" field in a policy manifest. The following values are\navailable to change the behavior:</p>\n<ul>\n<li><code>\"exit\"</code>: will exit the process immediately.\nNo cleanup code will be allowed to run.</li>\n<li><code>\"log\"</code>: will log the error at the site of the failure.</li>\n<li><code>\"throw\"</code>: will throw a JS error at the site of the failure. This is the\ndefault.</li>\n</ul>\n<pre><code class=\"language-json\">{\n  \"onerror\": \"log\",\n  \"resources\": {\n    \"./app/checked.js\": {\n      \"integrity\": \"sha384-SggXRQHwCG8g+DktYYzxkXRIkTiEYWBHqev0xnpCxYlqMBufKZHAHQM3/boDaI/0\"\n    }\n  }\n}\n</code></pre>",
              "type": "module",
              "displayName": "Error behavior"
            },
            {
              "textRaw": "Integrity checks",
              "name": "integrity_checks",
              "desc": "<p>Policy files must use integrity checks with Subresource Integrity strings\ncompatible with the browser\n<a href=\"https://www.w3.org/TR/SRI/#the-integrity-attribute\">integrity attribute</a>\nassociated with absolute URLs.</p>\n<p>When using <code>require()</code> all resources involved in loading are checked for\nintegrity if a policy manifest has been specified. If a resource does not match\nthe integrity listed in the manifest, an error will be thrown.</p>\n<p>An example policy file that would allow loading a file <code>checked.js</code>:</p>\n<pre><code class=\"language-json\">{\n  \"resources\": {\n    \"./app/checked.js\": {\n      \"integrity\": \"sha384-SggXRQHwCG8g+DktYYzxkXRIkTiEYWBHqev0xnpCxYlqMBufKZHAHQM3/boDaI/0\"\n    }\n  }\n}\n</code></pre>\n<p>Each resource listed in the policy manifest can be of one the following\nformats to determine its location:</p>\n<ol>\n<li>A <a href=\"https://url.spec.whatwg.org/#relative-url-with-fragment-string\">relative url string</a> to a resource from the manifest such as <code>./resource.js</code>, <code>../resource.js</code>, or <code>/resource.js</code>.</li>\n<li>A complete url string to a resource such as <code>file:///resource.js</code>.</li>\n</ol>\n<p>When loading resources the entire URL must match including search parameters\nand hash fragment. <code>./a.js?b</code> will not be used when attempting to load\n<code>./a.js</code> and vice versa.</p>\n<p>To generate integrity strings, a script such as\n<code>printf \"sha384-$(cat checked.js | openssl dgst -sha384 -binary | base64)\"</code>\ncan be used.</p>\n<p>Integrity can be specified as the boolean value <code>true</code> to accept any\nbody for the resource which can be useful for local development. It is not\nrecommended in production since it would allow unexpected alteration of\nresources to be considered valid.</p>",
              "type": "module",
              "displayName": "Integrity checks"
            },
            {
              "textRaw": "Dependency redirection",
              "name": "dependency_redirection",
              "desc": "<p>An application may need to ship patched versions of modules or to prevent\nmodules from allowing all modules access to all other modules. Redirection\ncan be used by intercepting attempts to load the modules wishing to be\nreplaced.</p>\n<pre><code class=\"language-json\">{\n  \"builtins\": [],\n  \"resources\": {\n    \"./app/checked.js\": {\n      \"dependencies\": {\n        \"fs\": true,\n        \"os\": \"./app/node_modules/alt-os\"\n      }\n    }\n  }\n}\n</code></pre>\n<p>The dependencies are keyed by the requested string specifier and have values\nof either <code>true</code> or a string pointing to a module that will be resolved.</p>\n<p>The specifier string does not perform any searching and must match exactly\nwhat is provided to the <code>require()</code>. Therefore, multiple specifiers may be\nneeded in the policy if <code>require()</code> uses multiple different strings to point\nto the same module (such as excluding the extension).</p>\n<p>If the value of the redirection is <code>true</code> the default searching algorithms will\nbe used to find the module.</p>\n<p>If the value of the redirection is a string, it will be resolved relative to\nthe manifest and then immediately be used without searching.</p>\n<p>Any specifier string that is <code>require()</code>ed and not listed in the dependencies\nwill result in an error according to the policy.</p>\n<p>Redirection will not prevent access to APIs through means such as direct access\nto <code>require.cache</code> and/or through <code>module.constructor</code> which allow access to\nloading modules. Policy redirection only affect specifiers to <code>require()</code>.\nOther means such as to prevent undesired access to APIs through variables are\nnecessary to lock down that path of loading modules.</p>\n<p>A boolean value of <code>true</code> for the dependencies map can be specified to allow a\nmodule to load any specifier without redirection. This can be useful for local\ndevelopment and may have some valid usage in production, but should be used\nonly with care after auditing a module to ensure its behavior is valid.</p>\n<h4>Example: Patched dependency</h4>\n<p>Redirected dependencies can provide attenuated or modified functionality as fits\nthe application. For example, log data about timing of function durations by\nwrapping the original:</p>\n<pre><code class=\"language-js\">const original = require('fn');\nmodule.exports = function fn(...args) {\n  console.time();\n  try {\n    return new.target ?\n      Reflect.construct(original, args) :\n      Reflect.apply(original, this, args);\n  } finally {\n    console.timeEnd();\n  }\n};\n</code></pre>",
              "type": "module",
              "displayName": "Dependency redirection"
            }
          ],
          "type": "misc",
          "displayName": "Features"
        }
      ]
    },
    {
      "textRaw": "Diagnostic report",
      "name": "report",
      "introduced_in": "v11.8.0",
      "type": "misc",
      "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\": 1,\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      \"http_parser\": \"2.8.0\",\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\": 6127616,\n    \"totalCommittedMemory\": 4357352,\n    \"usedMemory\": 3221136,\n    \"availableMemory\": 1521370240,\n    \"memoryLimit\": 1526909922,\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    \"userCpuSeconds\": 0.069595,\n    \"kernelCpuSeconds\": 0.019163,\n    \"cpuConsumptionPercent\": 0.000000,\n    \"maxRss\": 18079744,\n    \"pageFaults\": {\n      \"IORequired\": 0,\n      \"IONotRequired\": 4610\n    },\n    \"fsActivity\": {\n      \"reads\": 0,\n      \"writes\": 0\n    }\n  },\n  \"uvthreadResourceUsage\": {\n    \"userCpuSeconds\": 0.068457,\n    \"kernelCpuSeconds\": 0.019127,\n    \"cpuConsumptionPercent\": 0.000000,\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    }\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_kbytes\": {\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_kbytes\": {\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_kbytes\": {\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",
          "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 below\non how to modify the signal that triggers the report.) Default signal is <code>SIGUSR2</code>.\nUseful 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\nfatal errors (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</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>",
          "type": "misc",
          "displayName": "Usage"
        },
        {
          "textRaw": "Configuration",
          "name": "configuration",
          "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 filesystem directory where the report will be written.\nURLs are not supported. Defaults to the current working directory of the\nNode.js process.</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</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>",
          "type": "misc",
          "displayName": "Configuration"
        },
        {
          "textRaw": "Interaction with workers",
          "name": "interaction_with_workers",
          "meta": {
            "changes": [
              {
                "version": "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>",
          "type": "misc",
          "displayName": "Interaction with workers"
        }
      ]
    }
  ],
  "modules": [
    {
      "textRaw": "Usage and example",
      "name": "usage_and_example",
      "introduced_in": "v0.10.0",
      "miscs": [
        {
          "textRaw": "Usage",
          "name": "Usage",
          "introduced_in": "v0.10.0",
          "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#cli_command_line_options\">Command Line Options</a> document for more information.</p>\n<h2>Example</h2>\n<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 <a href=\"https://nodejs.org/en/download/package-manager/\">this guide</a>\nfor 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-console\">$ mkdir ~/projects\n$ cd ~/projects\n</code></pre>\n<p>Windows CMD:</p>\n<pre><code class=\"language-console\">> mkdir %USERPROFILE%\\projects\n> cd %USERPROFILE%\\projects\n</code></pre>\n<p>Windows PowerShell:</p>\n<pre><code class=\"language-console\">> mkdir $env:USERPROFILE\\projects\n> cd $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('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, go back to the terminal window, and enter the following command:</p>\n<pre><code class=\"language-console\">$ 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>"
        }
      ],
      "type": "module",
      "displayName": "Usage and example"
    },
    {
      "textRaw": "Assert",
      "name": "assert",
      "introduced_in": "v0.1.21",
      "stability": 2,
      "stabilityText": "Stable",
      "desc": "<p>The <code>assert</code> module provides a set of assertion functions for verifying\ninvariants.</p>",
      "modules": [
        {
          "textRaw": "Strict assertion mode",
          "name": "strict_assertion_mode",
          "meta": {
            "added": [
              "v9.9.0"
            ],
            "changes": [
              {
                "version": "v12.16.2",
                "description": "Changed \"strict mode\" to \"strict assertion mode\" and \"legacy mode\" to \"legacy assertion mode\" to avoid confusion with the more usual meaining 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=\"assert.html#assert_assert_deepequal_actual_expected_message\"><code>assert.deepEqual()</code></a> will behave like\n<a href=\"assert.html#assert_assert_deepstrictequal_actual_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>\n<p>To use strict assertion mode:</p>\n<pre><code class=\"language-js\">const assert = require('assert').strict;\n</code></pre>\n<p>Example error diff:</p>\n<pre><code class=\"language-js\">const assert = require('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#tty_writestream_getcolordepth_env\">getColorDepth()</a> documentation.</p>",
          "type": "module",
          "displayName": "Strict assertion mode"
        },
        {
          "textRaw": "Legacy assertion mode",
          "name": "legacy_assertion_mode",
          "desc": "<p>Legacy assertion mode uses the <a href=\"https://tc39.github.io/ecma262/#sec-abstract-equality-comparison\">Abstract Equality Comparison</a> in:</p>\n<ul>\n<li><a href=\"assert.html#assert_assert_deepequal_actual_expected_message\"><code>assert.deepEqual()</code></a></li>\n<li><a href=\"assert.html#assert_assert_equal_actual_expected_message\"><code>assert.equal()</code></a></li>\n<li><a href=\"assert.html#assert_assert_notdeepequal_actual_expected_message\"><code>assert.notDeepEqual()</code></a></li>\n<li><a href=\"assert.html#assert_assert_notequal_actual_expected_message\"><code>assert.notEqual()</code></a></li>\n</ul>\n<p>To use legacy assertion mode:</p>\n<pre><code class=\"language-js\">const assert = require('assert');\n</code></pre>\n<p>Whenever possible, use the <a href=\"assert.html#assert_strict_assertion_mode\">strict assertion mode</a> instead. Otherwise, the\n<a href=\"https://tc39.github.io/ecma262/#sec-abstract-equality-comparison\">Abstract Equality Comparison</a> may cause surprising results. This is\nespecially true for <a href=\"assert.html#assert_assert_deepequal_actual_expected_message\"><code>assert.deepEqual()</code></a>, where the comparison rules are\nlax:</p>\n<pre><code class=\"language-js\">// WARNING: This does not throw an AssertionError!\nassert.deepEqual(/a/gi, new Date());\n</code></pre>",
          "type": "module",
          "displayName": "Legacy assertion mode"
        }
      ],
      "classes": [
        {
          "textRaw": "Class: assert.AssertionError",
          "type": "class",
          "name": "assert.AssertionError",
          "desc": "<ul>\n<li>Extends: <a href=\"errors.html#errors_class_error\" class=\"type\">&lt;errors.Error&gt;</a></li>\n</ul>\n<p>Indicates the failure of an assertion. All errors thrown by the <code>assert</code> module\nwill be instances of the <code>AssertionError</code> class.</p>",
          "signatures": [
            {
              "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."
                    }
                  ]
                }
              ],
              "desc": "<p>A subclass of <code>Error</code> 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/en-US/docs/Web/JavaScript/Data_structures#Data_types\" class=\"type\">&lt;any&gt;</a> Set to the <code>actual</code> argument for methods such as\n<a href=\"assert.html#assert_assert_strictequal_actual_expected_message\"><code>assert.strictEqual()</code></a>.</li>\n<li><code>expected</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Data_types\" class=\"type\">&lt;any&gt;</a> Set to the <code>expected</code> value for methods such as\n<a href=\"assert.html#assert_assert_strictequal_actual_expected_message\"><code>assert.strictEqual()</code></a>.</li>\n<li><code>generatedMessage</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type\" class=\"type\">&lt;boolean&gt;</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/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string&gt;</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/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string&gt;</a> Set to the passed in operator value.</li>\n</ul>\n<pre><code class=\"language-js\">const assert = require('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>"
            }
          ]
        }
      ],
      "methods": [
        {
          "textRaw": "`assert(value[, message])`",
          "type": "method",
          "name": "assert",
          "meta": {
            "added": [
              "v0.5.9"
            ],
            "changes": []
          },
          "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}",
                  "name": "message",
                  "type": "string|Error"
                }
              ]
            }
          ],
          "desc": "<p>An alias of <a href=\"assert.html#assert_assert_ok_value_message\"><code>assert.ok()</code></a>.</p>"
        },
        {
          "textRaw": "`assert.deepEqual(actual, expected[, message])`",
          "type": "method",
          "name": "deepEqual",
          "meta": {
            "added": [
              "v0.1.21"
            ],
            "changes": [
              {
                "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."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`actual` {any}",
                  "name": "actual",
                  "type": "any"
                },
                {
                  "textRaw": "`expected` {any}",
                  "name": "expected",
                  "type": "any"
                },
                {
                  "textRaw": "`message` {string|Error}",
                  "name": "message",
                  "type": "string|Error"
                }
              ]
            }
          ],
          "desc": "<p><strong>Strict assertion mode</strong></p>\n<p>An alias of <a href=\"assert.html#assert_assert_deepstrictequal_actual_expected_message\"><code>assert.deepStrictEqual()</code></a>.</p>\n<p><strong>Legacy assertion mode</strong></p>\n<blockquote>\n<p>Stability: 0 - Deprecated: Use <a href=\"assert.html#assert_assert_deepstrictequal_actual_expected_message\"><code>assert.deepStrictEqual()</code></a> instead.</p>\n</blockquote>\n<p>Tests for deep equality between the <code>actual</code> and <code>expected</code> parameters. Consider\nusing <a href=\"assert.html#assert_assert_deepstrictequal_actual_expected_message\"><code>assert.deepStrictEqual()</code></a> instead. <a href=\"assert.html#assert_assert_deepequal_actual_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",
              "desc": "<ul>\n<li>Primitive values are compared with the <a href=\"https://tc39.github.io/ecma262/#sec-abstract-equality-comparison\">Abstract Equality Comparison</a>\n( <code>==</code> ).</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/Enumerability_and_ownership_of_properties\">enumerable \"own\" properties</a> are considered.</li>\n<li><a href=\"errors.html#errors_class_error\"><code>Error</code></a> names and messages are always compared, even if these are not\nenumerable properties.</li>\n<li><a href=\"https://developer.mozilla.org/en-US/docs/Glossary/Primitive#Primitive_wrapper_objects_in_JavaScript\">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/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map\"><code>Map</code></a> keys and <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set\"><code>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>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/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol\"><code>Symbol</code></a> properties are not compared.</li>\n<li><a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap\"><code>WeakMap</code></a> and <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet\"><code>WeakSet</code></a> comparison does not rely on their values.</li>\n</ul>\n<p>The following example does not throw an <a href=\"assert.html#assert_class_assert_assertionerror\"><code>AssertionError</code></a> because the\nprimitives are considered equal by the <a href=\"https://tc39.github.io/ecma262/#sec-abstract-equality-comparison\">Abstract Equality Comparison</a>\n( <code>==</code> ).</p>\n<pre><code class=\"language-js\">// WARNING: This does not throw an AssertionError!\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-js\">const assert = require('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 = Object.create(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=\"assert.html#assert_class_assert_assertionerror\"><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>\nparameter is an instance of an <a href=\"errors.html#errors_class_error\"><code>Error</code></a> then it will be thrown instead of the\n<a href=\"assert.html#assert_class_assert_assertionerror\"><code>AssertionError</code></a>.</p>",
              "type": "module",
              "displayName": "Comparison details"
            }
          ]
        },
        {
          "textRaw": "`assert.deepStrictEqual(actual, expected[, message])`",
          "type": "method",
          "name": "deepStrictEqual",
          "meta": {
            "added": [
              "v1.2.0"
            ],
            "changes": [
              {
                "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}",
                  "name": "message",
                  "type": "string|Error"
                }
              ]
            }
          ],
          "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",
              "desc": "<ul>\n<li>Primitive values are compared using the <a href=\"https://tc39.github.io/ecma262/#sec-samevalue\">SameValue Comparison</a>, used by\n<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://tc39.github.io/ecma262/#sec-strict-equality-comparison\">Strict Equality Comparison</a>.</li>\n<li>Only <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Enumerability_and_ownership_of_properties\">enumerable \"own\" properties</a> are considered.</li>\n<li><a href=\"errors.html#errors_class_error\"><code>Error</code></a> names and messages are always compared, even if these are not\nenumerable properties.</li>\n<li>Enumerable own <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol\"><code>Symbol</code></a> properties are compared as well.</li>\n<li><a href=\"https://developer.mozilla.org/en-US/docs/Glossary/Primitive#Primitive_wrapper_objects_in_JavaScript\">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/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map\"><code>Map</code></a> keys and <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set\"><code>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/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap\"><code>WeakMap</code></a> and <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet\"><code>WeakSet</code></a> comparison does not rely on their values. See\nbelow for further details.</li>\n</ul>\n<pre><code class=\"language-js\">const assert = require('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 of the SameValue comparison\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 using the SameValue Comparison:\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 weakMap3 = new WeakMap();\nweakMap3.unequal = true;\n\nassert.deepStrictEqual(weakMap1, weakMap2);\n// OK, because it is impossible to compare the entries\n\n// Fails because weakMap3 has a property that weakMap1 does not contain:\nassert.deepStrictEqual(weakMap1, weakMap3);\n// AssertionError: Expected inputs to be strictly deep-equal:\n// + actual - expected\n//\n//   WeakMap {\n// +   [items unknown]\n// -   [items unknown],\n// -   unequal: true\n//   }\n</code></pre>\n<p>If the values are not equal, an <a href=\"assert.html#assert_class_assert_assertionerror\"><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>\nparameter is an instance of an <a href=\"errors.html#errors_class_error\"><code>Error</code></a> then it will be thrown instead of the\n<code>AssertionError</code>.</p>",
              "type": "module",
              "displayName": "Comparison details"
            }
          ]
        },
        {
          "textRaw": "`assert.doesNotMatch(string, regexp[, message])`",
          "type": "method",
          "name": "doesNotMatch",
          "meta": {
            "added": [
              "v12.16.0"
            ],
            "changes": []
          },
          "stability": 1,
          "stabilityText": "Experimental",
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`string` {string}",
                  "name": "string",
                  "type": "string"
                },
                {
                  "textRaw": "`regexp` {RegExp}",
                  "name": "regexp",
                  "type": "RegExp"
                },
                {
                  "textRaw": "`message` {string|Error}",
                  "name": "message",
                  "type": "string|Error"
                }
              ]
            }
          ],
          "desc": "<p>Expects the <code>string</code> input not to match the regular expression.</p>\n<p>This feature is currently experimental and the name might change or it might be\ncompletely removed again.</p>\n<pre><code class=\"language-js\">const assert = require('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=\"assert.html#assert_class_assert_assertionerror\"><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 an <a href=\"errors.html#errors_class_error\"><code>Error</code></a> then it will be thrown instead of the\n<a href=\"assert.html#assert_class_assert_assertionerror\"><code>AssertionError</code></a>.</p>"
        },
        {
          "textRaw": "`assert.doesNotReject(asyncFn[, error][, message])`",
          "type": "method",
          "name": "doesNotReject",
          "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"
                },
                {
                  "textRaw": "`message` {string}",
                  "name": "message",
                  "type": "string"
                }
              ]
            }
          ],
          "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#errors_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/en-US/docs/Web/JavaScript/Guide/Regular_Expressions\"><code>RegExp</code></a> or a validation\nfunction. See <a href=\"assert.html#assert_assert_throws_fn_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=\"assert.html#assert_assert_doesnotthrow_fn_error_message\"><code>assert.doesNotThrow()</code></a>.</p>\n<!-- eslint-disable no-restricted-syntax -->\n<pre><code class=\"language-js\">(async () => {\n  await assert.doesNotReject(\n    async () => {\n      throw new TypeError('Wrong value');\n    },\n    SyntaxError\n  );\n})();\n</code></pre>\n<!-- eslint-disable no-restricted-syntax -->\n<pre><code class=\"language-js\">assert.doesNotReject(Promise.reject(new TypeError('Wrong value')))\n  .then(() => {\n    // ...\n  });\n</code></pre>"
        },
        {
          "textRaw": "`assert.doesNotThrow(fn[, error][, message])`",
          "type": "method",
          "name": "doesNotThrow",
          "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"
                },
                {
                  "textRaw": "`message` {string}",
                  "name": "message",
                  "type": "string"
                }
              ]
            }
          ],
          "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=\"assert.html#assert_class_assert_assertionerror\"><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/en-US/docs/Web/JavaScript/Guide/Regular_Expressions\"><code>RegExp</code></a> or a validation\nfunction. See <a href=\"assert.html#assert_assert_throws_fn_error_message\"><code>assert.throws()</code></a> for more details.</p>\n<p>The following, for instance, will throw the <a href=\"errors.html#errors_class_typeerror\"><code>TypeError</code></a> because there is no\nmatching error type in the assertion:</p>\n<!-- eslint-disable no-restricted-syntax -->\n<pre><code class=\"language-js\">assert.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=\"assert.html#assert_class_assert_assertionerror\"><code>AssertionError</code></a> with the message\n'Got unwanted exception...':</p>\n<!-- eslint-disable no-restricted-syntax -->\n<pre><code class=\"language-js\">assert.doesNotThrow(\n  () => {\n    throw new TypeError('Wrong value');\n  },\n  TypeError\n);\n</code></pre>\n<p>If an <a href=\"assert.html#assert_class_assert_assertionerror\"><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=\"assert.html#assert_class_assert_assertionerror\"><code>AssertionError</code></a>\nmessage:</p>\n<!-- eslint-disable no-restricted-syntax -->\n<pre><code class=\"language-js\">assert.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])`",
          "type": "method",
          "name": "equal",
          "meta": {
            "added": [
              "v0.1.21"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`actual` {any}",
                  "name": "actual",
                  "type": "any"
                },
                {
                  "textRaw": "`expected` {any}",
                  "name": "expected",
                  "type": "any"
                },
                {
                  "textRaw": "`message` {string|Error}",
                  "name": "message",
                  "type": "string|Error"
                }
              ]
            }
          ],
          "desc": "<p><strong>Strict assertion mode</strong></p>\n<p>An alias of <a href=\"assert.html#assert_assert_strictequal_actual_expected_message\"><code>assert.strictEqual()</code></a>.</p>\n<p><strong>Legacy assertion mode</strong></p>\n<blockquote>\n<p>Stability: 0 - Deprecated: Use <a href=\"assert.html#assert_assert_strictequal_actual_expected_message\"><code>assert.strictEqual()</code></a> instead.</p>\n</blockquote>\n<p>Tests shallow, coercive equality between the <code>actual</code> and <code>expected</code> parameters\nusing the <a href=\"https://tc39.github.io/ecma262/#sec-abstract-equality-comparison\">Abstract Equality Comparison</a> ( <code>==</code> ).</p>\n<pre><code class=\"language-js\">const assert = require('assert');\n\nassert.equal(1, 1);\n// OK, 1 == 1\nassert.equal(1, '1');\n// OK, 1 == '1'\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=\"assert.html#assert_class_assert_assertionerror\"><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>\nparameter is an instance of an <a href=\"errors.html#errors_class_error\"><code>Error</code></a> then it will be thrown instead of the\n<code>AssertionError</code>.</p>"
        },
        {
          "textRaw": "`assert.fail([message])`",
          "type": "method",
          "name": "fail",
          "meta": {
            "added": [
              "v0.1.21"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`message` {string|Error} **Default:** `'Failed'`",
                  "name": "message",
                  "type": "string|Error",
                  "default": "`'Failed'`"
                }
              ]
            }
          ],
          "desc": "<p>Throws an <a href=\"assert.html#assert_class_assert_assertionerror\"><code>AssertionError</code></a> with the provided error message or a default\nerror message. If the <code>message</code> parameter is an instance of an <a href=\"errors.html#errors_class_error\"><code>Error</code></a> then\nit will be thrown instead of the <a href=\"assert.html#assert_class_assert_assertionerror\"><code>AssertionError</code></a>.</p>\n<pre><code class=\"language-js\">const assert = require('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<p>Using <code>assert.fail()</code> with more than two arguments is possible but deprecated.\nSee below for further details.</p>"
        },
        {
          "textRaw": "`assert.fail(actual, expected[, message[, operator[, stackStartFn]]])`",
          "type": "method",
          "name": "fail",
          "meta": {
            "added": [
              "v0.1.21"
            ],
            "changes": [
              {
                "version": "v10.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/18418",
                "description": "Calling `assert.fail()` with more than one argument is deprecated and emits a warning."
              }
            ]
          },
          "stability": 0,
          "stabilityText": "Deprecated: Use `assert.fail([message])` or other assert\nfunctions instead.",
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`actual` {any}",
                  "name": "actual",
                  "type": "any"
                },
                {
                  "textRaw": "`expected` {any}",
                  "name": "expected",
                  "type": "any"
                },
                {
                  "textRaw": "`message` {string|Error}",
                  "name": "message",
                  "type": "string|Error"
                },
                {
                  "textRaw": "`operator` {string} **Default:** `'!='`",
                  "name": "operator",
                  "type": "string",
                  "default": "`'!='`"
                },
                {
                  "textRaw": "`stackStartFn` {Function} **Default:** `assert.fail`",
                  "name": "stackStartFn",
                  "type": "Function",
                  "default": "`assert.fail`"
                }
              ]
            }
          ],
          "desc": "<p>If <code>message</code> is falsy, the error message is set as the values of <code>actual</code> and\n<code>expected</code> separated by the provided <code>operator</code>. If just the two <code>actual</code> and\n<code>expected</code> arguments are provided, <code>operator</code> will default to <code>'!='</code>. If\n<code>message</code> is provided as third argument it will be used as the error message and\nthe other arguments will be stored as properties on the thrown object. If\n<code>stackStartFn</code> is provided, all stack frames above that function will be\nremoved from stacktrace (see <a href=\"errors.html#errors_error_capturestacktrace_targetobject_constructoropt\"><code>Error.captureStackTrace</code></a>). If no arguments are\ngiven, the default message <code>Failed</code> will be used.</p>\n<pre><code class=\"language-js\">const assert = require('assert').strict;\n\nassert.fail('a', 'b');\n// AssertionError [ERR_ASSERTION]: 'a' != 'b'\n\nassert.fail(1, 2, undefined, '>');\n// AssertionError [ERR_ASSERTION]: 1 > 2\n\nassert.fail(1, 2, 'fail');\n// AssertionError [ERR_ASSERTION]: fail\n\nassert.fail(1, 2, 'whoops', '>');\n// AssertionError [ERR_ASSERTION]: whoops\n\nassert.fail(1, 2, new TypeError('need array'));\n// TypeError: need array\n</code></pre>\n<p>In the last three cases <code>actual</code>, <code>expected</code>, and <code>operator</code> have no\ninfluence on the error message.</p>\n<p>Example use of <code>stackStartFn</code> for truncating the exception's stacktrace:</p>\n<pre><code class=\"language-js\">function suppressFrame() {\n  assert.fail('a', 'b', undefined, '!==', suppressFrame);\n}\nsuppressFrame();\n// AssertionError [ERR_ASSERTION]: 'a' !== 'b'\n//     at repl:1:1\n//     at ContextifyScript.Script.runInThisContext (vm.js:44:33)\n//     ...\n</code></pre>"
        },
        {
          "textRaw": "`assert.ifError(value)`",
          "type": "method",
          "name": "ifError",
          "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-js\">const assert = require('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])`",
          "type": "method",
          "name": "match",
          "meta": {
            "added": [
              "v12.16.0"
            ],
            "changes": []
          },
          "stability": 1,
          "stabilityText": "Experimental",
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`string` {string}",
                  "name": "string",
                  "type": "string"
                },
                {
                  "textRaw": "`regexp` {RegExp}",
                  "name": "regexp",
                  "type": "RegExp"
                },
                {
                  "textRaw": "`message` {string|Error}",
                  "name": "message",
                  "type": "string|Error"
                }
              ]
            }
          ],
          "desc": "<p>Expects the <code>string</code> input to match the regular expression.</p>\n<p>This feature is currently experimental and the name might change or it might be\ncompletely removed again.</p>\n<pre><code class=\"language-js\">const assert = require('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=\"assert.html#assert_class_assert_assertionerror\"><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 an <a href=\"errors.html#errors_class_error\"><code>Error</code></a> then it will be thrown instead of the\n<a href=\"assert.html#assert_class_assert_assertionerror\"><code>AssertionError</code></a>.</p>"
        },
        {
          "textRaw": "`assert.notDeepEqual(actual, expected[, message])`",
          "type": "method",
          "name": "notDeepEqual",
          "meta": {
            "added": [
              "v0.1.21"
            ],
            "changes": [
              {
                "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."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`actual` {any}",
                  "name": "actual",
                  "type": "any"
                },
                {
                  "textRaw": "`expected` {any}",
                  "name": "expected",
                  "type": "any"
                },
                {
                  "textRaw": "`message` {string|Error}",
                  "name": "message",
                  "type": "string|Error"
                }
              ]
            }
          ],
          "desc": "<p><strong>Strict assertion mode</strong></p>\n<p>An alias of <a href=\"assert.html#assert_assert_notdeepstrictequal_actual_expected_message\"><code>assert.notDeepStrictEqual()</code></a>.</p>\n<p><strong>Legacy assertion mode</strong></p>\n<blockquote>\n<p>Stability: 0 - Deprecated: Use <a href=\"assert.html#assert_assert_notdeepstrictequal_actual_expected_message\"><code>assert.notDeepStrictEqual()</code></a> instead.</p>\n</blockquote>\n<p>Tests for any deep inequality. Opposite of <a href=\"assert.html#assert_assert_deepequal_actual_expected_message\"><code>assert.deepEqual()</code></a>.</p>\n<pre><code class=\"language-js\">const assert = require('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 = Object.create(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=\"assert.html#assert_class_assert_assertionerror\"><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 an <a href=\"errors.html#errors_class_error\"><code>Error</code></a> then it will be thrown\ninstead of the <code>AssertionError</code>.</p>"
        },
        {
          "textRaw": "`assert.notDeepStrictEqual(actual, expected[, message])`",
          "type": "method",
          "name": "notDeepStrictEqual",
          "meta": {
            "added": [
              "v1.2.0"
            ],
            "changes": [
              {
                "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}",
                  "name": "message",
                  "type": "string|Error"
                }
              ]
            }
          ],
          "desc": "<p>Tests for deep strict inequality. Opposite of <a href=\"assert.html#assert_assert_deepstrictequal_actual_expected_message\"><code>assert.deepStrictEqual()</code></a>.</p>\n<pre><code class=\"language-js\">const assert = require('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=\"assert.html#assert_class_assert_assertionerror\"><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 an <a href=\"errors.html#errors_class_error\"><code>Error</code></a> then it will be thrown\ninstead of the <a href=\"assert.html#assert_class_assert_assertionerror\"><code>AssertionError</code></a>.</p>"
        },
        {
          "textRaw": "`assert.notEqual(actual, expected[, message])`",
          "type": "method",
          "name": "notEqual",
          "meta": {
            "added": [
              "v0.1.21"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`actual` {any}",
                  "name": "actual",
                  "type": "any"
                },
                {
                  "textRaw": "`expected` {any}",
                  "name": "expected",
                  "type": "any"
                },
                {
                  "textRaw": "`message` {string|Error}",
                  "name": "message",
                  "type": "string|Error"
                }
              ]
            }
          ],
          "desc": "<p><strong>Strict assertion mode</strong></p>\n<p>An alias of <a href=\"assert.html#assert_assert_notstrictequal_actual_expected_message\"><code>assert.notStrictEqual()</code></a>.</p>\n<p><strong>Legacy assertion mode</strong></p>\n<blockquote>\n<p>Stability: 0 - Deprecated: Use <a href=\"assert.html#assert_assert_notstrictequal_actual_expected_message\"><code>assert.notStrictEqual()</code></a> instead.</p>\n</blockquote>\n<p>Tests shallow, coercive inequality with the <a href=\"https://tc39.github.io/ecma262/#sec-abstract-equality-comparison\">Abstract Equality Comparison</a>\n( <code>!=</code> ).</p>\n<pre><code class=\"language-js\">const assert = require('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=\"assert.html#assert_class_assert_assertionerror\"><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>\nparameter is an instance of an <a href=\"errors.html#errors_class_error\"><code>Error</code></a> then it will be thrown instead of the\n<code>AssertionError</code>.</p>"
        },
        {
          "textRaw": "`assert.notStrictEqual(actual, expected[, message])`",
          "type": "method",
          "name": "notStrictEqual",
          "meta": {
            "added": [
              "v0.1.21"
            ],
            "changes": [
              {
                "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}",
                  "name": "message",
                  "type": "string|Error"
                }
              ]
            }
          ],
          "desc": "<p>Tests strict inequality between the <code>actual</code> and <code>expected</code> parameters as\ndetermined by the <a href=\"https://tc39.github.io/ecma262/#sec-samevalue\">SameValue Comparison</a>.</p>\n<pre><code class=\"language-js\">const assert = require('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=\"assert.html#assert_class_assert_assertionerror\"><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 an <a href=\"errors.html#errors_class_error\"><code>Error</code></a> then it will be thrown\ninstead of the <code>AssertionError</code>.</p>"
        },
        {
          "textRaw": "`assert.ok(value[, message])`",
          "type": "method",
          "name": "ok",
          "meta": {
            "added": [
              "v0.1.21"
            ],
            "changes": [
              {
                "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}",
                  "name": "message",
                  "type": "string|Error"
                }
              ]
            }
          ],
          "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=\"assert.html#assert_class_assert_assertionerror\"><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>\nparameter is an instance of an <a href=\"errors.html#errors_class_error\"><code>Error</code></a> then it will be thrown instead of the\n<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-js\">const assert = require('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\n// Using `assert()` works the same:\nassert(0);\n// AssertionError: The expression evaluated to a falsy value:\n//\n//   assert(0)\n</code></pre>"
        },
        {
          "textRaw": "`assert.rejects(asyncFn[, error][, message])`",
          "type": "method",
          "name": "rejects",
          "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"
                },
                {
                  "textRaw": "`message` {string}",
                  "name": "message",
                  "type": "string"
                }
              ]
            }
          ],
          "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#errors_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=\"assert.html#assert_assert_throws_fn_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/en-US/docs/Web/JavaScript/Guide/Regular_Expressions\"><code>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=\"assert.html#assert_class_assert_assertionerror\"><code>AssertionError</code></a>\nif the <code>asyncFn</code> fails to reject.</p>\n<pre><code class=\"language-js\">(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-js\">(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-js\">assert.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=\"assert.html#assert_assert_throws_fn_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])`",
          "type": "method",
          "name": "strictEqual",
          "meta": {
            "added": [
              "v0.1.21"
            ],
            "changes": [
              {
                "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}",
                  "name": "message",
                  "type": "string|Error"
                }
              ]
            }
          ],
          "desc": "<p>Tests strict equality between the <code>actual</code> and <code>expected</code> parameters as\ndetermined by the <a href=\"https://tc39.github.io/ecma262/#sec-samevalue\">SameValue Comparison</a>.</p>\n<pre><code class=\"language-js\">const assert = require('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(1, '1', new TypeError('Inputs are not identical'));\n// TypeError: Inputs are not identical\n</code></pre>\n<p>If the values are not strictly equal, an <a href=\"assert.html#assert_class_assert_assertionerror\"><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 an <a href=\"errors.html#errors_class_error\"><code>Error</code></a> then it will be thrown\ninstead of the <a href=\"assert.html#assert_class_assert_assertionerror\"><code>AssertionError</code></a>.</p>"
        },
        {
          "textRaw": "`assert.throws(fn[, error][, message])`",
          "type": "method",
          "name": "throws",
          "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"
                },
                {
                  "textRaw": "`message` {string}",
                  "name": "message",
                  "type": "string"
                }
              ]
            }
          ],
          "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/en-US/docs/Web/JavaScript/Guide/Regular_Expressions\"><code>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-js\">const 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-js\">assert.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/en-US/docs/Web/JavaScript/Guide/Regular_Expressions\"><code>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-js\">assert.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=\"assert.html#assert_class_assert_assertionerror\"><code>AssertionError</code></a>.</p>\n<pre><code class=\"language-js\">assert.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<!-- eslint-disable no-restricted-syntax -->\n<pre><code class=\"language-js\">function 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>"
        }
      ],
      "type": "module",
      "displayName": "Assert"
    },
    {
      "textRaw": "Async hooks",
      "name": "async_hooks",
      "introduced_in": "v8.1.0",
      "stability": 1,
      "stabilityText": "Experimental",
      "desc": "<p>The <code>async_hooks</code> module provides an API to track asynchronous resources. It\ncan be accessed using:</p>\n<pre><code class=\"language-js\">const async_hooks = require('async_hooks');\n</code></pre>",
      "modules": [
        {
          "textRaw": "Terminology",
          "name": "terminology",
          "desc": "<p>An asynchronous resource represents an object with an associated callback.\nThis callback may be called multiple times, for example, 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#worker_threads_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>",
          "type": "module",
          "displayName": "Terminology"
        },
        {
          "textRaw": "Public API",
          "name": "public_api",
          "modules": [
            {
              "textRaw": "Overview",
              "name": "overview",
              "desc": "<p>Following is a simple overview of the public API.</p>\n<pre><code class=\"language-js\">const async_hooks = require('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 (e.g. TCPWrap), and will be called exactly 1\n// time for requests (e.g. 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>",
              "methods": [
                {
                  "textRaw": "`async_hooks.createHook(callbacks)`",
                  "type": "method",
                  "name": "createHook",
                  "meta": {
                    "added": [
                      "v8.1.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "return": {
                        "textRaw": "Returns: {AsyncHook} Instance used for disabling and enabling hooks",
                        "name": "return",
                        "type": "AsyncHook",
                        "desc": "Instance used for disabling and enabling hooks"
                      },
                      "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": "`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][]."
                            }
                          ]
                        }
                      ]
                    }
                  ],
                  "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=\"async_hooks.html#async_hooks_hook_callbacks\">Hook Callbacks</a> section.</p>\n<pre><code class=\"language-js\">const async_hooks = require('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>",
                  "modules": [
                    {
                      "textRaw": "Error handling",
                      "name": "error_handling",
                      "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>",
                      "type": "module",
                      "displayName": "Error handling"
                    },
                    {
                      "textRaw": "Printing in AsyncHooks callbacks",
                      "name": "printing_in_asynchooks_callbacks",
                      "desc": "<p>Because printing to the console is an asynchronous operation, <code>console.log()</code>\nwill cause the AsyncHooks callbacks to be called. Using <code>console.log()</code> or\nsimilar asynchronous operations inside an AsyncHooks callback function will thus\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 AsyncHooks recursively because\nit is synchronous.</p>\n<pre><code class=\"language-js\">const fs = require('fs');\nconst util = require('util');\n\nfunction debug(...args) {\n  // Use a function like this one when debugging inside an AsyncHooks 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 AsyncHooks itself. The logging should then be skipped when\nit was the logging itself that caused AsyncHooks callback to call. By\ndoing this the otherwise infinite recursion is broken.</p>",
                      "type": "module",
                      "displayName": "Printing in AsyncHooks callbacks"
                    }
                  ]
                }
              ],
              "type": "module",
              "displayName": "Overview"
            }
          ],
          "classes": [
            {
              "textRaw": "Class: `AsyncHook`",
              "type": "class",
              "name": "AsyncHook",
              "desc": "<p>The class <code>AsyncHook</code> exposes an interface for tracking lifetime events\nof asynchronous operations.</p>",
              "methods": [
                {
                  "textRaw": "`asyncHook.enable()`",
                  "type": "method",
                  "name": "enable",
                  "signatures": [
                    {
                      "return": {
                        "textRaw": "Returns: {AsyncHook} A reference to `asyncHook`.",
                        "name": "return",
                        "type": "AsyncHook",
                        "desc": "A reference to `asyncHook`."
                      },
                      "params": []
                    }
                  ],
                  "desc": "<p>Enable the callbacks for a given <code>AsyncHook</code> instance. If no callbacks are\nprovided enabling is a noop.</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-js\">const async_hooks = require('async_hooks');\n\nconst hook = async_hooks.createHook(callbacks).enable();\n</code></pre>"
                },
                {
                  "textRaw": "`asyncHook.disable()`",
                  "type": "method",
                  "name": "disable",
                  "signatures": [
                    {
                      "return": {
                        "textRaw": "Returns: {AsyncHook} A reference to `asyncHook`.",
                        "name": "return",
                        "type": "AsyncHook",
                        "desc": "A reference to `asyncHook`."
                      },
                      "params": []
                    }
                  ],
                  "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()`",
                  "type": "method",
                  "name": "executionAsyncResource",
                  "meta": {
                    "added": [
                      "v12.17.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "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."
                      },
                      "params": []
                    }
                  ],
                  "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-js\">const { open } = require('fs');\nconst { executionAsyncId, executionAsyncResource } = require('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-js\">const { createServer } = require('http');\nconst {\n  executionAsyncId,\n  executionAsyncResource,\n  createHook\n} = require('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()`",
                  "type": "method",
                  "name": "executionAsyncId",
                  "meta": {
                    "added": [
                      "v8.1.0"
                    ],
                    "changes": [
                      {
                        "version": "v8.2.0",
                        "pr-url": "https://github.com/nodejs/node/pull/13490",
                        "description": "Renamed from `currentId`"
                      }
                    ]
                  },
                  "signatures": [
                    {
                      "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."
                      },
                      "params": []
                    }
                  ],
                  "desc": "<pre><code class=\"language-js\">const async_hooks = require('async_hooks');\n\nconsole.log(async_hooks.executionAsyncId());  // 1 - bootstrap\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 (i.e. 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=\"async_hooks.html#async_hooks_promise_execution_tracking\">promise execution tracking</a>.</p>"
                },
                {
                  "textRaw": "`async_hooks.triggerAsyncId()`",
                  "type": "method",
                  "name": "triggerAsyncId",
                  "signatures": [
                    {
                      "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."
                      },
                      "params": []
                    }
                  ],
                  "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=\"async_hooks.html#async_hooks_promise_execution_tracking\">promise execution tracking</a>.</p>"
                }
              ],
              "modules": [
                {
                  "textRaw": "Hook callbacks",
                  "name": "hook_callbacks",
                  "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)`",
                      "type": "method",
                      "name": "init",
                      "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-js\">require('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`",
                          "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<pre><code class=\"language-text\">FSEVENTWRAP, FSREQCALLBACK, GETADDRINFOREQWRAP, GETNAMEINFOREQWRAP, HTTPINCOMINGMESSAGE,\nHTTPCLIENTREQUEST, JSSTREAM, PIPECONNECTWRAP, PIPEWRAP, PROCESSWRAP, QUERYWRAP,\nSHUTDOWNWRAP, SIGNALWRAP, STATWATCHER, TCPCONNECTWRAP, TCPSERVERWRAP, TCPWRAP,\nTTYWRAP, UDPSENDWRAP, UDPWRAP, WRITEWRAP, ZLIB, SSLCONNECTION, PBKDF2REQUEST,\nRANDOMBYTESREQUEST, TLSWRAP, Microtask, Timeout, Immediate, TickObject\n</code></pre>\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.</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>",
                          "type": "module",
                          "displayName": "`type`"
                        },
                        {
                          "textRaw": "`triggerAsyncId`",
                          "name": "`triggerasyncid`",
                          "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-js\">async_hooks.createHook({\n  init(asyncId, type, triggerAsyncId) {\n    const eid = async_hooks.executionAsyncId();\n    fs.writeSync(\n      1, `${type}(${asyncId}): trigger: ${triggerAsyncId} execution: ${eid}\\n`);\n  }\n}).enable();\n\nrequire('net').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>",
                          "type": "module",
                          "displayName": "`triggerAsyncId`"
                        },
                        {
                          "textRaw": "`resource`",
                          "name": "`resource`",
                          "desc": "<p><code>resource</code> is an object that represents the actual async resource that has\nbeen initialized. This can contain useful information that can vary based on\nthe value of <code>type</code>. For instance, for the <code>GETADDRINFOREQWRAP</code> resource type,\n<code>resource</code> provides the host name used when looking up the IP address for the\nhost in <code>net.Server.listen()</code>. The API for accessing this information is\ncurrently not considered public, but using the Embedder API, users can provide\nand document their own resource objects. For example, such a resource object\ncould contain the SQL query being executed.</p>\n<p>In the case of Promises, the <code>resource</code> object will have an\n<code>isChainedPromise</code> property, set to <code>true</code> if the promise has a parent promise,\nand <code>false</code> otherwise. For example, in the case of <code>b = a.then(handler)</code>, <code>a</code> is\nconsidered a parent <code>Promise</code> of <code>b</code>. Here, <code>b</code> is considered a chained promise.</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>",
                          "type": "module",
                          "displayName": "`resource`"
                        },
                        {
                          "textRaw": "Asynchronous context example",
                          "name": "asynchronous_context_example",
                          "desc": "<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-js\">let 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      1,\n      `${indentStr}${type}(${asyncId}):` +\n      ` trigger: ${triggerAsyncId} execution: ${eid}\\n`);\n  },\n  before(asyncId) {\n    const indentStr = ' '.repeat(indent);\n    fs.writeFileSync('log.out',\n                     `${indentStr}before:  ${asyncId}\\n`, { flag: 'a' });\n    indent += 2;\n  },\n  after(asyncId) {\n    indent -= 2;\n    const indentStr = ' '.repeat(indent);\n    fs.writeFileSync('log.out',\n                     `${indentStr}after:  ${asyncId}\\n`, { flag: 'a' });\n  },\n  destroy(asyncId) {\n    const indentStr = ' '.repeat(indent);\n    fs.writeFileSync('log.out',\n                     `${indentStr}destroy:  ${asyncId}\\n`, { flag: 'a' });\n  },\n}).enable();\n\nrequire('net').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\">Timeout(7) -> TickObject(6) -> root(1)\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>.</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>.</p>",
                          "type": "module",
                          "displayName": "Asynchronous context example"
                        }
                      ]
                    },
                    {
                      "textRaw": "`before(asyncId)`",
                      "type": "method",
                      "name": "before",
                      "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)`",
                      "type": "method",
                      "name": "after",
                      "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)`",
                      "type": "method",
                      "name": "destroy",
                      "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>"
                    },
                    {
                      "textRaw": "`promiseResolve(asyncId)`",
                      "type": "method",
                      "name": "promiseResolve",
                      "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>"
                    }
                  ],
                  "type": "module",
                  "displayName": "Hook callbacks"
                }
              ]
            }
          ],
          "type": "module",
          "displayName": "Public API"
        },
        {
          "textRaw": "Promise execution tracking",
          "name": "promise_execution_tracking",
          "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-js\">const ah = require('async_hooks');\nPromise.resolve(1729).then(() => {\n  console.log(`eid ${ah.executionAsyncId()} tid ${ah.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-js\">const ah = require('async_hooks');\nah.createHook({ init() {} }).enable(); // forces PromiseHooks to be enabled.\nPromise.resolve(1729).then(() => {\n  console.log(`eid ${ah.executionAsyncId()} tid ${ah.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>",
          "type": "module",
          "displayName": "Promise execution tracking"
        },
        {
          "textRaw": "JavaScript embedder API",
          "name": "javascript_embedder_api",
          "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`",
              "type": "class",
              "name": "AsyncResource",
              "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-js\">const { AsyncResource, executionAsyncId } = require('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>",
              "methods": [
                {
                  "textRaw": "`asyncResource.runInAsyncScope(fn[, thisArg, ...args])`",
                  "type": "method",
                  "name": "runInAsyncScope",
                  "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."
                        },
                        {
                          "textRaw": "`...args` {any} Optional arguments to pass to the function.",
                          "name": "...args",
                          "type": "any",
                          "desc": "Optional arguments to pass to the function."
                        }
                      ]
                    }
                  ],
                  "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()`",
                  "type": "method",
                  "name": "emitDestroy",
                  "signatures": [
                    {
                      "return": {
                        "textRaw": "Returns: {AsyncResource} A reference to `asyncResource`.",
                        "name": "return",
                        "type": "AsyncResource",
                        "desc": "A reference to `asyncResource`."
                      },
                      "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>"
                },
                {
                  "textRaw": "`asyncResource.asyncId()`",
                  "type": "method",
                  "name": "asyncId",
                  "signatures": [
                    {
                      "return": {
                        "textRaw": "Returns: {number} The unique `asyncId` assigned to the resource.",
                        "name": "return",
                        "type": "number",
                        "desc": "The unique `asyncId` assigned to the resource."
                      },
                      "params": []
                    }
                  ]
                },
                {
                  "textRaw": "`asyncResource.triggerAsyncId()`",
                  "type": "method",
                  "name": "triggerAsyncId",
                  "signatures": [
                    {
                      "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."
                      },
                      "params": []
                    }
                  ],
                  "desc": "<p><a id=\"async-resource-worker-pool\"></a></p>"
                }
              ],
              "signatures": [
                {
                  "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."
                        }
                      ]
                    }
                  ],
                  "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>"
                }
              ]
            }
          ],
          "modules": [
            {
              "textRaw": "Using `AsyncResource` for a `Worker` thread pool",
              "name": "using_`asyncresource`_for_a_`worker`_thread_pool",
              "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#worker_threads_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-js\">const { parentPort } = require('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-js\">const { AsyncResource } = require('async_hooks');\nconst { EventEmitter } = require('events');\nconst path = require('path');\nconst { Worker } = require('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\n    for (let i = 0; i &#x3C; numThreads; i++)\n      this.addNewWorker();\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.once(kWorkerFreedEvent, () => this.runTask(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-js\">const WorkerPool = require('./worker_pool.js');\nconst os = require('os');\n\nconst pool = new WorkerPool(os.cpus().length);\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>",
              "type": "module",
              "displayName": "Using `AsyncResource` for a `Worker` thread pool"
            },
            {
              "textRaw": "Integrating `AsyncResource` with `EventEmitter`",
              "name": "integrating_`asyncresource`_with_`eventemitter`",
              "desc": "<p>Event listeners triggered by an <a href=\"events.html#events_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_stream\"><code>Stream</code></a> or a similar event-driven class.</p>\n<pre><code class=\"language-js\">const { createServer } = require('http');\nconst { AsyncResource, executionAsyncId } = require('async_hooks');\n\nconst server = createServer((req, res) => {\n  const asyncResource = new AsyncResource('request');\n  // The listener will always run in the execution context of `asyncResource`.\n  req.on('close', asyncResource.runInAsyncScope.bind(asyncResource, () => {\n    // Prints: true\n    console.log(asyncResource.asyncId() === executionAsyncId());\n  }));\n  res.end();\n}).listen(3000);\n</code></pre>",
              "type": "module",
              "displayName": "Integrating `AsyncResource` with `EventEmitter`"
            }
          ],
          "type": "module",
          "displayName": "JavaScript embedder API"
        }
      ],
      "classes": [
        {
          "textRaw": "Class: `AsyncLocalStorage`",
          "type": "class",
          "name": "AsyncLocalStorage",
          "meta": {
            "added": [
              "v12.17.0"
            ],
            "changes": []
          },
          "desc": "<p>This class is used to create asynchronous state within callbacks and promise\nchains. It allows 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 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-js\">const http = require('http');\nconst { AsyncLocalStorage } = require('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//   1: start\n//   0: finish\n//   1: finish\n</code></pre>\n<p>When having multiple instances of <code>AsyncLocalStorage</code>, they are independent\nfrom each other. It is safe to instantiate this class multiple times.</p>",
          "methods": [
            {
              "textRaw": "`asyncLocalStorage.disable()`",
              "type": "method",
              "name": "disable",
              "meta": {
                "added": [
                  "v12.17.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>This method 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> 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>This method is to be used when the <code>asyncLocalStorage</code> is not in use anymore\nin the current process.</p>"
            },
            {
              "textRaw": "`asyncLocalStorage.getStore()`",
              "type": "method",
              "name": "getStore",
              "meta": {
                "added": [
                  "v12.17.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {any}",
                    "name": "return",
                    "type": "any"
                  },
                  "params": []
                }
              ],
              "desc": "<p>This method returns the current store.\nIf this method is called outside of an asynchronous context initialized by\ncalling <code>asyncLocalStorage.run</code>, it will return <code>undefined</code>.</p>"
            },
            {
              "textRaw": "`asyncLocalStorage.enterWith(store)`",
              "type": "method",
              "name": "enterWith",
              "meta": {
                "added": [
                  "v12.17.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`store` {any}",
                      "name": "store",
                      "type": "any"
                    }
                  ]
                }
              ],
              "desc": "<p>Calling <code>asyncLocalStorage.enterWith(store)</code> will transition into the context\nfor the remainder of the current synchronous execution and will persist\nthrough any following asynchronous calls.</p>\n<p>Example:</p>\n<pre><code class=\"language-js\">const store = { id: 1 };\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>.</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])`",
              "type": "method",
              "name": "run",
              "meta": {
                "added": [
                  "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"
                    }
                  ]
                }
              ],
              "desc": "<p>This methods runs a function synchronously within a context and return its\nreturn value. The store is not accessible outside of the callback function or\nthe asynchronous operations created within the callback.</p>\n<p>Optionally, arguments can be passed to the function. They will be passed to\nthe callback function.</p>\n<p>If the callback function throws an error, it will be thrown by <code>run</code> too.\nThe stacktrace will not be impacted by this call and the context will\nbe 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    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])`",
              "type": "method",
              "name": "exit",
              "meta": {
                "added": [
                  "v12.17.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function"
                    },
                    {
                      "textRaw": "`...args` {any}",
                      "name": "...args",
                      "type": "any"
                    }
                  ]
                }
              ],
              "desc": "<p>This methods runs a function synchronously outside of a context and return its\nreturn value. The store is not accessible within the callback function or\nthe asynchronous operations created within the callback.</p>\n<p>Optionally, arguments can be passed to the function. They will be passed to\nthe callback function.</p>\n<p>If the callback function throws an error, it will be thrown by <code>exit</code> too.\nThe stacktrace will not be impacted by this call and\nthe context will be 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>"
            }
          ],
          "modules": [
            {
              "textRaw": "Usage with `async/await`",
              "name": "usage_with_`async/await`",
              "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>",
              "type": "module",
              "displayName": "Usage with `async/await`"
            },
            {
              "textRaw": "Troubleshooting",
              "name": "troubleshooting",
              "desc": "<p>In most cases your application or library code should have no issues with\n<code>AsyncLocalStorage</code>. But in rare cases you may face situations when the\ncurrent store is lost in one of asynchronous operations. Then you should\nconsider the following options.</p>\n<p>If your code is callback-based, it is enough to promisify it with\n<a href=\"util.html#util_util_promisify_original\"><code>util.promisify()</code></a>, so it starts working with native promises.</p>\n<p>If you need to keep using callback-based API, or your code assumes\na custom thenable implementation, you should use <a href=\"async_hooks.html#async_hooks_class_asyncresource\"><code>AsyncResource</code></a> class\nto associate the asynchronous operation with the correct execution context.</p>",
              "type": "module",
              "displayName": "Troubleshooting"
            }
          ],
          "signatures": [
            {
              "params": [],
              "desc": "<p>Creates a new instance of <code>AsyncLocalStorage</code>. Store is only provided within a\n<code>run</code> method call.</p>"
            }
          ]
        }
      ],
      "type": "module",
      "displayName": "Async hooks"
    },
    {
      "textRaw": "Buffer",
      "name": "buffer",
      "introduced_in": "v0.1.90",
      "stability": 2,
      "stabilityText": "Stable",
      "desc": "<p>In Node.js, <code>Buffer</code> objects are used to represent binary data in the form\nof a sequence of bytes. Many Node.js APIs, for example streams and file system\noperations, support <code>Buffer</code>s, as interactions with the operating system or\nother processes generally always happen in terms of binary data.</p>\n<p>The <code>Buffer</code> class is a subclass of the <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array\"><code>Uint8Array</code></a> class that is built\ninto the JavaScript language. A number of additional methods are supported\nthat cover additional use cases. Node.js APIs accept plain <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array\"><code>Uint8Array</code></a>s\nwherever <code>Buffer</code>s are supported as well.</p>\n<p>Instances of <code>Buffer</code>, and instances of <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array\"><code>Uint8Array</code></a> in general,\nare similar to arrays of integers from <code>0</code> to <code>255</code>, but correspond to\nfixed-sized blocks of memory and cannot contain any other values.\nThe size of a <code>Buffer</code> is established when it is created and cannot be changed.</p>\n<p>The <code>Buffer</code> class is within the global scope, making it unlikely that one\nwould need to ever use <code>require('buffer').Buffer</code>.</p>\n<pre><code class=\"language-js\">// 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",
          "meta": {
            "changes": [
              {
                "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-js\">const 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>The character encodings currently supported by Node.js are the following:</p>\n<ul>\n<li>\n<p><code>'utf8'</code>: Multi-byte encoded Unicode characters. Many web pages and other\ndocument formats use <a href=\"https://en.wikipedia.org/wiki/UTF-8\">UTF-8</a>. This is the default character encoding.\nWhen decoding a <code>Buffer</code> into a string that does not exclusively contain\nvalid UTF-8 data, the Unicode replacement character <code>U+FFFD</code> � will be used\nto represent those errors.</p>\n</li>\n<li>\n<p><code>'utf16le'</code>: Multi-byte encoded Unicode characters. Unlike <code>'utf8'</code>, each\ncharacter in the string will be encoded using either 2 or 4 bytes.\nNode.js only supports the <a href=\"https://en.wikipedia.org/wiki/Endianness\">little-endian</a> variant of <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 two 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>.</p>\n</li>\n<li>\n<p><code>'hex'</code>: Encode each byte as two hexadecimal characters. Data truncation\nmay occur when decoding string that do exclusively contain valid hexadecimal\ncharacters. 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 encoding this 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>. See <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/DOMString/Binary\">binary strings</a> for more background\non this topic. The 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>'utf-8'</code> is the right choice.</p>\n</li>\n<li>\n<p><code>'ucs2'</code>: Alias of <code>'utf16le'</code>. UCS-2 used to refer to a variant of UTF-16\nthat did not support characters that had code points larger than U+FFFF.\nIn Node.js, these code points are always supported.</p>\n</li>\n</ul>\n<pre><code class=\"language-js\">Buffer.from('1ag', 'hex');\n// Prints &#x3C;Buffer 1a>, data truncated when first non-hexadecimal value\n// ('g') encountered.\n\nBuffer.from('1a7g', '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>",
          "type": "module",
          "displayName": "Buffers and character encodings"
        },
        {
          "textRaw": "Buffers and TypedArrays",
          "name": "buffers_and_typedarrays",
          "meta": {
            "changes": [
              {
                "version": "v3.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/2002",
                "description": "The `Buffer`s class now inherits from `Uint8Array`."
              }
            ]
          },
          "desc": "<p><code>Buffer</code> instances are also <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array\"><code>Uint8Array</code></a> instances, which is the language’s\nbuilt-in class for working with binary data. <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array\"><code>Uint8Array</code></a> in turn is a\nsubclass of <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray\"><code>TypedArray</code></a>. Therefore, all <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray\"><code>TypedArray</code></a> methods are also\navailable on <code>Buffer</code>s. However, there are subtle incompatibilities between\nthe <code>Buffer</code> API and the <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray\"><code>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#slice()</code></a> creates a copy of part of the <code>TypedArray</code>,\n<a href=\"buffer.html#buffer_buf_slice_start_end\"><code>Buffer#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#subarray()</code></a> can be used to achieve the behavior\nof <a href=\"buffer.html#buffer_buf_slice_start_end\"><code>Buffer#slice()</code></a> on both <code>Buffer</code>s and other\n<code>TypedArray</code>s.</li>\n<li><a href=\"buffer.html#buffer_buf_tostring_encoding_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=\"buffer.html#buffer_buf_indexof_value_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/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray\"><code>TypedArray</code></a> instances from a <code>Buffer</code>.</p>\n<p>When passing a <code>Buffer</code> to a <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray\"><code>TypedArray</code></a> constructor, the <code>Buffer</code>’s\nelements will be copied, interpreted as an array of integers, and not as a byte\narray of the target type. For example,\n<code>new Uint32Array(Buffer.from([1, 2, 3, 4]))</code> creates a 4-element\n<a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array\"><code>Uint32Array</code></a> with elements <code>[1, 2, 3, 4]</code>, rather than a\n<a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array\"><code>Uint32Array</code></a> with a single element <code>[0x1020304]</code> or <code>[0x4030201]</code>.</p>\n<p>In order to create a <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray\"><code>TypedArray</code></a> that shares its memory with the <code>Buffer</code>,\nthe underlying <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer\"><code>ArrayBuffer</code></a> can be passed to the <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray\"><code>TypedArray</code></a>\nconstructor instead:</p>\n<pre><code class=\"language-js\">const buf = Buffer.from('hello', 'utf16le');\nconst uint16arr = new Uint16Array(\n  buf.buffer, buf.byteOffset, buf.length / Uint16Array.BYTES_PER_ELEMENT);\n</code></pre>\n<p>It is also possible to create a new <code>Buffer</code> that shares the same allocated\nmemory as a <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray\"><code>TypedArray</code></a> instance by using the <code>TypedArray</code> object’s\n<code>.buffer</code> property in the same way. <a href=\"buffer.html#buffer_class_method_buffer_from_arraybuffer_byteoffset_length\"><code>Buffer.from()</code></a>\nbehaves like <code>new Uint8Array()</code> in this context.</p>\n<pre><code class=\"language-js\">const arr = new Uint16Array(2);\n\narr[0] = 5000;\narr[1] = 4000;\n\n// Copies the contents of `arr`.\nconst buf1 = Buffer.from(arr);\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/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray\"><code>TypedArray</code></a>'s <code>.buffer</code>, it is\npossible to use only a portion of the underlying <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer\"><code>ArrayBuffer</code></a> by passing in\n<code>byteOffset</code> and <code>length</code> parameters.</p>\n<pre><code class=\"language-js\">const 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/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray\"><code>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><code>TypedArray.from(source[, mapFn[, thisArg]])</code></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=\"buffer.html#buffer_class_method_buffer_from_array\"><code>Buffer.from(array)</code></a></li>\n<li><a href=\"buffer.html#buffer_class_method_buffer_from_buffer\"><code>Buffer.from(buffer)</code></a></li>\n<li><a href=\"buffer.html#buffer_class_method_buffer_from_arraybuffer_byteoffset_length\"><code>Buffer.from(arrayBuffer[, byteOffset[, length]])</code></a></li>\n<li><a href=\"buffer.html#buffer_class_method_buffer_from_string_encoding\"><code>Buffer.from(string[, encoding])</code></a></li>\n</ul>",
          "type": "module",
          "displayName": "Buffers and TypedArrays"
        },
        {
          "textRaw": "Buffers and iteration",
          "name": "buffers_and_iteration",
          "desc": "<p><code>Buffer</code> instances can be iterated over using <code>for..of</code> syntax:</p>\n<pre><code class=\"language-js\">const 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=\"buffer.html#buffer_buf_values\"><code>buf.values()</code></a>, <a href=\"buffer.html#buffer_buf_keys\"><code>buf.keys()</code></a>, and\n<a href=\"buffer.html#buffer_buf_entries\"><code>buf.entries()</code></a> methods can be used to create iterators.</p>",
          "type": "module",
          "displayName": "Buffers and iteration"
        },
        {
          "textRaw": "Buffer constants",
          "name": "buffer_constants",
          "meta": {
            "added": [
              "v8.2.0"
            ],
            "changes": []
          },
          "desc": "<p><code>buffer.constants</code> is a property on the <code>buffer</code> module returned by\n<code>require('buffer')</code>, not on the <code>Buffer</code> global or a <code>Buffer</code> instance.</p>",
          "properties": [
            {
              "textRaw": "`MAX_LENGTH` {integer} The largest size allowed for a single `Buffer` instance.",
              "type": "integer",
              "name": "MAX_LENGTH",
              "meta": {
                "added": [
                  "v8.2.0"
                ],
                "changes": []
              },
              "desc": "<p>On 32-bit architectures, this value currently is <code>(2^30)-1</code> (~1GB).\nOn 64-bit architectures, this value currently is <code>(2^31)-1</code> (~2GB).</p>\n<p>This value is also available as <a href=\"buffer.html#buffer_buffer_kmaxlength\"><code>buffer.kMaxLength</code></a>.</p>",
              "shortDesc": "The largest size allowed for a single `Buffer` instance."
            },
            {
              "textRaw": "`MAX_STRING_LENGTH` {integer} The largest length allowed for a single `string` instance.",
              "type": "integer",
              "name": "MAX_STRING_LENGTH",
              "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."
            }
          ],
          "type": "module",
          "displayName": "Buffer constants"
        },
        {
          "textRaw": "`Buffer.from()`, `Buffer.alloc()`, and `Buffer.allocUnsafe()`",
          "name": "`buffer.from()`,_`buffer.alloc()`,_and_`buffer.allocunsafe()`",
          "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=\"buffer.html#buffer_buf_fill_value_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/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer\"><code>ArrayBuffer</code></a> or a <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer\"><code>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=\"buffer.html#buffer_class_method_buffer_alloc_size_fill_encoding\"><code>Buffer.alloc()</code></a>, and\n<a href=\"buffer.html#buffer_class_method_buffer_allocunsafe_size\"><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=\"buffer.html#buffer_class_method_buffer_from_array\"><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=\"buffer.html#buffer_class_method_buffer_from_arraybuffer_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/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer\"><code>ArrayBuffer</code></a>.</li>\n<li><a href=\"buffer.html#buffer_class_method_buffer_from_buffer\"><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=\"buffer.html#buffer_class_method_buffer_from_string_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=\"buffer.html#buffer_class_method_buffer_alloc_size_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=\"buffer.html#buffer_class_method_buffer_allocunsafe_size\"><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=\"buffer.html#buffer_class_method_buffer_allocunsafe_size\"><code>Buffer.allocUnsafe(size)</code></a> and\n<a href=\"buffer.html#buffer_class_method_buffer_allocunsafeslow_size\"><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=\"buffer.html#buffer_class_method_buffer_allocunsafe_size\"><code>Buffer.allocUnsafe()</code></a> and\n<a href=\"buffer.html#buffer_class_method_buffer_from_array\"><code>Buffer.from(array)</code></a> <em>may</em> be allocated off a shared internal memory pool\nif <code>size</code> is less than or equal to half <a href=\"buffer.html#buffer_class_property_buffer_poolsize\"><code>Buffer.poolSize</code></a>. Instances\nreturned by <a href=\"buffer.html#buffer_class_method_buffer_allocunsafeslow_size\"><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",
              "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=\"buffer.html#buffer_class_method_buffer_allocunsafe_size\"><code>Buffer.allocUnsafe()</code></a>,\n<a href=\"buffer.html#buffer_class_method_buffer_allocunsafeslow_size\"><code>Buffer.allocUnsafeSlow()</code></a>, and <code>new SlowBuffer(size)</code> are not zero-filled.\nUse of this flag can have a measurable negative impact on performance. Use the\n<code>--zero-fill-buffers</code> option only when necessary to enforce that newly allocated\n<code>Buffer</code> instances cannot contain 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>",
              "type": "module",
              "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\"?",
              "desc": "<p>When calling <a href=\"buffer.html#buffer_class_method_buffer_allocunsafe_size\"><code>Buffer.allocUnsafe()</code></a> and <a href=\"buffer.html#buffer_class_method_buffer_allocunsafeslow_size\"><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=\"buffer.html#buffer_class_method_buffer_allocunsafe_size\"><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=\"buffer.html#buffer_class_method_buffer_allocunsafe_size\"><code>Buffer.allocUnsafe()</code></a>, extra care <em>must</em> be taken in order to avoid\nintroducing security vulnerabilities into an application.</p>",
              "type": "module",
              "displayName": "What makes `Buffer.allocUnsafe()` and `Buffer.allocUnsafeSlow()` \"unsafe\"?"
            }
          ],
          "type": "module",
          "displayName": "`Buffer.from()`, `Buffer.alloc()`, and `Buffer.allocUnsafe()`"
        }
      ],
      "classes": [
        {
          "textRaw": "Class: `Buffer`",
          "type": "class",
          "name": "Buffer",
          "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": "Class Method: `Buffer.alloc(size[, fill[, encoding]])`",
              "type": "classMethod",
              "name": "alloc",
              "meta": {
                "added": [
                  "v5.10.0"
                ],
                "changes": [
                  {
                    "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."
                    },
                    {
                      "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."
                    }
                  ]
                }
              ],
              "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-js\">const 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=\"buffer.html#buffer_buffer_constants_max_length\"><code>buffer.constants.MAX_LENGTH</code></a> or smaller than 0, <a href=\"errors.html#ERR_INVALID_OPT_VALUE\"><code>ERR_INVALID_OPT_VALUE</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=\"buffer.html#buffer_buf_fill_value_offset_end_encoding\"><code>buf.fill(fill)</code></a>.</p>\n<pre><code class=\"language-js\">const 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=\"buffer.html#buffer_buf_fill_value_offset_end_encoding\"><code>buf.fill(fill, encoding)</code></a>.</p>\n<pre><code class=\"language-js\">const 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=\"buffer.html#buffer_class_method_buffer_alloc_size_fill_encoding\"><code>Buffer.alloc()</code></a> can be measurably slower than the alternative\n<a href=\"buffer.html#buffer_class_method_buffer_allocunsafe_size\"><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": "Class Method: `Buffer.allocUnsafe(size)`",
              "type": "classMethod",
              "name": "allocUnsafe",
              "meta": {
                "added": [
                  "v5.10.0"
                ],
                "changes": [
                  {
                    "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`."
                    }
                  ]
                }
              ],
              "desc": "<p>Allocates a new <code>Buffer</code> of <code>size</code> bytes. If <code>size</code> is larger than\n<a href=\"buffer.html#buffer_buffer_constants_max_length\"><code>buffer.constants.MAX_LENGTH</code></a> or smaller than 0, <a href=\"errors.html#ERR_INVALID_OPT_VALUE\"><code>ERR_INVALID_OPT_VALUE</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=\"buffer.html#buffer_class_method_buffer_alloc_size_fill_encoding\"><code>Buffer.alloc()</code></a> instead to initialize\n<code>Buffer</code> instances with zeroes.</p>\n<pre><code class=\"language-js\">const 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=\"buffer.html#buffer_class_property_buffer_poolsize\"><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=\"buffer.html#buffer_class_method_buffer_allocunsafe_size\"><code>Buffer.allocUnsafe()</code></a>,\n<a href=\"buffer.html#buffer_class_method_buffer_from_array\"><code>Buffer.from(array)</code></a>, and the deprecated <code>new Buffer(size)</code> constructor only\nwhen <code>size</code> is less than or equal to <code>Buffer.poolSize >> 1</code> (floor of\n<a href=\"buffer.html#buffer_class_property_buffer_poolsize\"><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=\"buffer.html#buffer_class_property_buffer_poolsize\"><code>Buffer.poolSize</code></a>. The\ndifference is subtle but can be important when an application requires the\nadditional performance that <a href=\"buffer.html#buffer_class_method_buffer_allocunsafe_size\"><code>Buffer.allocUnsafe()</code></a> provides.</p>"
            },
            {
              "textRaw": "Class Method: `Buffer.allocUnsafeSlow(size)`",
              "type": "classMethod",
              "name": "allocUnsafeSlow",
              "meta": {
                "added": [
                  "v5.12.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "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>Allocates a new <code>Buffer</code> of <code>size</code> bytes. If <code>size</code> is larger than\n<a href=\"buffer.html#buffer_buffer_constants_max_length\"><code>buffer.constants.MAX_LENGTH</code></a> or smaller than 0, <a href=\"errors.html#ERR_INVALID_OPT_VALUE\"><code>ERR_INVALID_OPT_VALUE</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=\"buffer.html#buffer_buf_fill_value_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=\"buffer.html#buffer_class_method_buffer_allocunsafe_size\"><code>Buffer.allocUnsafe()</code></a> to allocate new <code>Buffer</code> instances,\nallocations under 4KB are sliced from a single pre-allocated <code>Buffer</code>. This\nallows applications to avoid the garbage collection overhead of creating many\nindividually allocated <code>Buffer</code> instances. This approach improves both\nperformance and memory usage by eliminating the need to track and clean up as\nmany 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-js\">// 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": "Class Method: `Buffer.byteLength(string[, encoding])`",
              "type": "classMethod",
              "name": "byteLength",
              "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": [
                {
                  "return": {
                    "textRaw": "Returns: {integer} The number of bytes contained within `string`.",
                    "name": "return",
                    "type": "integer",
                    "desc": "The number of bytes contained within `string`."
                  },
                  "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."
                    }
                  ]
                }
              ],
              "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> and <code>'hex'</code>, this function assumes valid input. For strings that\ncontain non-base64/hex-encoded data (e.g. whitespace), the return value might be\ngreater than the length of a <code>Buffer</code> created from the string.</p>\n<pre><code class=\"language-js\">const 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 <code>Buffer</code>/<a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView\"><code>DataView</code></a>/<a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray\"><code>TypedArray</code></a>/<a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer\"><code>ArrayBuffer</code></a>/\n<a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer\"><code>SharedArrayBuffer</code></a>, the byte length as reported by <code>.byteLength</code>\nis returned.</p>"
            },
            {
              "textRaw": "Class Method: `Buffer.compare(buf1, buf2)`",
              "type": "classMethod",
              "name": "compare",
              "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": [
                {
                  "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."
                  },
                  "params": [
                    {
                      "textRaw": "`buf1` {Buffer|Uint8Array}",
                      "name": "buf1",
                      "type": "Buffer|Uint8Array"
                    },
                    {
                      "textRaw": "`buf2` {Buffer|Uint8Array}",
                      "name": "buf2",
                      "type": "Buffer|Uint8Array"
                    }
                  ]
                }
              ],
              "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=\"buffer.html#buffer_buf_compare_target_targetstart_targetend_sourcestart_sourceend\"><code>buf1.compare(buf2)</code></a>.</p>\n<pre><code class=\"language-js\">const 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": "Class Method: `Buffer.concat(list[, totalLength])`",
              "type": "classMethod",
              "name": "concat",
              "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": [
                {
                  "return": {
                    "textRaw": "Returns: {Buffer}",
                    "name": "return",
                    "type": "Buffer"
                  },
                  "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."
                    }
                  ]
                }
              ],
              "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 is coerced to 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>.</p>\n<pre><code class=\"language-js\">// 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>"
            },
            {
              "textRaw": "Class Method: `Buffer.from(array)`",
              "type": "classMethod",
              "name": "from",
              "meta": {
                "added": [
                  "v5.10.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`array` {integer[]}",
                      "name": "array",
                      "type": "integer[]"
                    }
                  ]
                }
              ],
              "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-js\">// 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>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=\"buffer.html#buffer_class_method_buffer_from_string_encoding\"><code>Buffer.from(string)</code></a> may also use the internal\n<code>Buffer</code> pool like <a href=\"buffer.html#buffer_class_method_buffer_allocunsafe_size\"><code>Buffer.allocUnsafe()</code></a> does.</p>"
            },
            {
              "textRaw": "Class Method: `Buffer.from(arrayBuffer[, byteOffset[, length]])`",
              "type": "classMethod",
              "name": "from",
              "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."
                    },
                    {
                      "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."
                    }
                  ]
                }
              ],
              "desc": "<p>This creates a view of the <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer\"><code>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/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray\"><code>TypedArray</code></a> instance, the newly created <code>Buffer</code> will share the same\nallocated memory as the <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray\"><code>TypedArray</code></a>.</p>\n<pre><code class=\"language-js\">const 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-js\">const 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/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer\"><code>ArrayBuffer</code></a> or a\n<a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer\"><code>SharedArrayBuffer</code></a> or another type appropriate for <code>Buffer.from()</code>\nvariants.</p>"
            },
            {
              "textRaw": "Class Method: `Buffer.from(buffer)`",
              "type": "classMethod",
              "name": "from",
              "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."
                    }
                  ]
                }
              ],
              "desc": "<p>Copies the passed <code>buffer</code> data onto a new <code>Buffer</code> instance.</p>\n<pre><code class=\"language-js\">const 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": "Class Method: `Buffer.from(object[, offsetOrEncoding[, length]])`",
              "type": "classMethod",
              "name": "from",
              "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."
                    },
                    {
                      "textRaw": "`length` {integer} A length.",
                      "name": "length",
                      "type": "integer",
                      "desc": "A length."
                    }
                  ]
                }
              ],
              "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-js\">const 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-js\">class 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": "Class Method: `Buffer.from(string[, encoding])`",
              "type": "classMethod",
              "name": "from",
              "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`."
                    }
                  ]
                }
              ],
              "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-js\">const 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>"
            },
            {
              "textRaw": "Class Method: `Buffer.isBuffer(obj)`",
              "type": "classMethod",
              "name": "isBuffer",
              "meta": {
                "added": [
                  "v0.1.101"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  },
                  "params": [
                    {
                      "textRaw": "`obj` {Object}",
                      "name": "obj",
                      "type": "Object"
                    }
                  ]
                }
              ],
              "desc": "<p>Returns <code>true</code> if <code>obj</code> is a <code>Buffer</code>, <code>false</code> otherwise.</p>"
            },
            {
              "textRaw": "Class Method: `Buffer.isEncoding(encoding)`",
              "type": "classMethod",
              "name": "isEncoding",
              "meta": {
                "added": [
                  "v0.9.1"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  },
                  "params": [
                    {
                      "textRaw": "`encoding` {string} A character encoding name to check.",
                      "name": "encoding",
                      "type": "string",
                      "desc": "A character encoding name to check."
                    }
                  ]
                }
              ],
              "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-js\">console.log(Buffer.isEncoding('utf-8'));\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": "`poolSize` {integer} **Default:** `8192`",
              "type": "integer",
              "name": "poolSize",
              "meta": {
                "added": [
                  "v0.11.3"
                ],
                "changes": []
              },
              "default": "`8192`",
              "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]` `index` {integer}",
              "type": "integer",
              "name": "index",
              "meta": {
                "type": "property",
                "name": [
                  "index"
                ],
                "changes": []
              },
              "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 <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-js\">// 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": "`buffer` {ArrayBuffer} The underlying `ArrayBuffer` object based on which this `Buffer` object is created.",
              "type": "ArrayBuffer",
              "name": "buffer",
              "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-js\">const 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": "`byteOffset` {integer} The `byteOffset` on the underlying `ArrayBuffer` object based on which this `Buffer` object is created.",
              "type": "integer",
              "name": "byteOffset",
              "desc": "<p>When setting <code>byteOffset</code> in <code>Buffer.from(ArrayBuffer, byteOffset, length)</code>,\nor sometimes when allocating a buffer smaller than <code>Buffer.poolSize</code>, the\nbuffer doesn't 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>buf</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-js\">// Create a buffer smaller than `Buffer.poolSize`.\nconst nodeBuffer = new 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` on the underlying `ArrayBuffer` object based on which this `Buffer` object is created."
            },
            {
              "textRaw": "`length` {integer}",
              "type": "integer",
              "name": "length",
              "meta": {
                "added": [
                  "v0.1.90"
                ],
                "changes": []
              },
              "desc": "<p>Returns the number of bytes in <code>buf</code>.</p>\n<pre><code class=\"language-js\">// 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",
              "meta": {
                "deprecated": [
                  "v8.0.0"
                ],
                "changes": []
              },
              "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]]]])`",
              "type": "method",
              "name": "compare",
              "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": [
                {
                  "return": {
                    "textRaw": "Returns: {integer}",
                    "name": "return",
                    "type": "integer"
                  },
                  "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."
                    },
                    {
                      "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)."
                    },
                    {
                      "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."
                    },
                    {
                      "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)."
                    }
                  ]
                }
              ],
              "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-js\">const 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-js\">const 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]]])`",
              "type": "method",
              "name": "copy",
              "meta": {
                "added": [
                  "v0.1.90"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {integer} The number of bytes copied.",
                    "name": "return",
                    "type": "integer",
                    "desc": "The number of bytes copied."
                  },
                  "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."
                    },
                    {
                      "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."
                    },
                    {
                      "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)."
                    }
                  ]
                }
              ],
              "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#set()</code></a> performs the same operation, and is available for all\nTypedArrays, including Node.js <code>Buffer</code>s, although it takes different\nfunction arguments.</p>\n<pre><code class=\"language-js\">// 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-js\">// 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()`",
              "type": "method",
              "name": "entries",
              "meta": {
                "added": [
                  "v1.1.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Iterator}",
                    "name": "return",
                    "type": "Iterator"
                  },
                  "params": []
                }
              ],
              "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-js\">// 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)`",
              "type": "method",
              "name": "equals",
              "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": [
                {
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  },
                  "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`."
                    }
                  ]
                }
              ],
              "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=\"buffer.html#buffer_buf_compare_target_targetstart_targetend_sourcestart_sourceend\"><code>buf.compare(otherBuffer) === 0</code></a>.</p>\n<pre><code class=\"language-js\">const 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])`",
              "type": "method",
              "name": "fill",
              "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": [
                {
                  "return": {
                    "textRaw": "Returns: {Buffer} A reference to `buf`.",
                    "name": "return",
                    "type": "Buffer",
                    "desc": "A reference to `buf`."
                  },
                  "params": [
                    {
                      "textRaw": "`value` {string|Buffer|Uint8Array|integer} The value with which to fill `buf`.",
                      "name": "value",
                      "type": "string|Buffer|Uint8Array|integer",
                      "desc": "The value with which to fill `buf`."
                    },
                    {
                      "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`."
                    },
                    {
                      "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)."
                    },
                    {
                      "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."
                    }
                  ]
                }
              ],
              "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-js\">// 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</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-js\">// 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-js\">const 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[, byteOffset][, encoding])`",
              "type": "method",
              "name": "includes",
              "meta": {
                "added": [
                  "v5.3.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "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."
                  },
                  "params": [
                    {
                      "textRaw": "`value` {string|Buffer|Uint8Array|integer} What to search for.",
                      "name": "value",
                      "type": "string|Buffer|Uint8Array|integer",
                      "desc": "What to search for."
                    },
                    {
                      "textRaw": "`byteOffset` {integer} Where to begin searching in `buf`. If negative, then offset is calculated from the end of `buf`. **Default:** `0`.",
                      "name": "byteOffset",
                      "type": "integer",
                      "default": "`0`",
                      "desc": "Where to begin searching in `buf`. If negative, then offset is calculated from the end of `buf`."
                    },
                    {
                      "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."
                    }
                  ]
                }
              ],
              "desc": "<p>Equivalent to <a href=\"buffer.html#buffer_buf_indexof_value_byteoffset_encoding\"><code>buf.indexOf() !== -1</code></a>.</p>\n<pre><code class=\"language-js\">const 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[, byteOffset][, encoding])`",
              "type": "method",
              "name": "indexOf",
              "meta": {
                "added": [
                  "v1.5.0"
                ],
                "changes": [
                  {
                    "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": [
                {
                  "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`."
                  },
                  "params": [
                    {
                      "textRaw": "`value` {string|Buffer|Uint8Array|integer} What to search for.",
                      "name": "value",
                      "type": "string|Buffer|Uint8Array|integer",
                      "desc": "What to search for."
                    },
                    {
                      "textRaw": "`byteOffset` {integer} Where to begin searching in `buf`. If negative, then offset is calculated from the end of `buf`. **Default:** `0`.",
                      "name": "byteOffset",
                      "type": "integer",
                      "default": "`0`",
                      "desc": "Where to begin searching in `buf`. If negative, then offset is calculated from the end of `buf`."
                    },
                    {
                      "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`."
                    }
                  ]
                }
              ],
              "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/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array\"><code>Uint8Array</code></a>, <code>value</code> will be used in its entirety.\nTo compare a partial <code>Buffer</code>, use <a href=\"buffer.html#buffer_buf_slice_start_end\"><code>buf.slice()</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-js\">const 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#indexOf()</code></a>.</p>\n<pre><code class=\"language-js\">const 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()`",
              "type": "method",
              "name": "keys",
              "meta": {
                "added": [
                  "v1.1.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Iterator}",
                    "name": "return",
                    "type": "Iterator"
                  },
                  "params": []
                }
              ],
              "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 (indices).</p>\n<pre><code class=\"language-js\">const 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[, byteOffset][, encoding])`",
              "type": "method",
              "name": "lastIndexOf",
              "meta": {
                "added": [
                  "v6.0.0"
                ],
                "changes": [
                  {
                    "version": "v8.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10236",
                    "description": "The `value` can now be a `Uint8Array`."
                  }
                ]
              },
              "signatures": [
                {
                  "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`."
                  },
                  "params": [
                    {
                      "textRaw": "`value` {string|Buffer|Uint8Array|integer} What to search for.",
                      "name": "value",
                      "type": "string|Buffer|Uint8Array|integer",
                      "desc": "What to search for."
                    },
                    {
                      "textRaw": "`byteOffset` {integer} Where to begin searching in `buf`. If negative, then offset is calculated from the end of `buf`. **Default:** `buf.length - 1`.",
                      "name": "byteOffset",
                      "type": "integer",
                      "default": "`buf.length - 1`",
                      "desc": "Where to begin searching in `buf`. If negative, then offset is calculated from the end of `buf`."
                    },
                    {
                      "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`."
                    }
                  ]
                }
              ],
              "desc": "<p>Identical to <a href=\"buffer.html#buffer_buf_indexof_value_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-js\">const 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#lastIndexOf()</code></a>.</p>\n<pre><code class=\"language-js\">const 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])`",
              "type": "method",
              "name": "readBigInt64BE",
              "meta": {
                "added": [
                  "v12.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {bigint}",
                    "name": "return",
                    "type": "bigint"
                  },
                  "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`."
                    }
                  ]
                }
              ],
              "desc": "<p>Reads a signed 64-bit integer from <code>buf</code> at the specified <code>offset</code> with\nthe specified <a href=\"https://en.wikipedia.org/wiki/Endianness\">endianness</a> (<code>readBigInt64BE()</code> reads as big endian,\n<code>readBigInt64LE()</code> reads as little endian).</p>\n<p>Integers read from a <code>Buffer</code> are interpreted as two's complement signed values.</p>"
            },
            {
              "textRaw": "`buf.readBigInt64LE([offset])`",
              "type": "method",
              "name": "readBigInt64LE",
              "meta": {
                "added": [
                  "v12.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {bigint}",
                    "name": "return",
                    "type": "bigint"
                  },
                  "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`."
                    }
                  ]
                }
              ],
              "desc": "<p>Reads a signed 64-bit integer from <code>buf</code> at the specified <code>offset</code> with\nthe specified <a href=\"https://en.wikipedia.org/wiki/Endianness\">endianness</a> (<code>readBigInt64BE()</code> reads as big endian,\n<code>readBigInt64LE()</code> reads as little endian).</p>\n<p>Integers read from a <code>Buffer</code> are interpreted as two's complement signed values.</p>"
            },
            {
              "textRaw": "`buf.readBigUInt64BE([offset])`",
              "type": "method",
              "name": "readBigUInt64BE",
              "meta": {
                "added": [
                  "v12.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {bigint}",
                    "name": "return",
                    "type": "bigint"
                  },
                  "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`."
                    }
                  ]
                }
              ],
              "desc": "<p>Reads an unsigned 64-bit integer from <code>buf</code> at the specified <code>offset</code> with\nthe specified <a href=\"https://en.wikipedia.org/wiki/Endianness\">endianness</a> (<code>readBigUInt64BE()</code> reads as big endian,\n<code>readBigUInt64LE()</code> reads as little endian).</p>\n<pre><code class=\"language-js\">const buf = Buffer.from([0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff]);\n\nconsole.log(buf.readBigUInt64BE(0));\n// Prints: 4294967295n\n\nconsole.log(buf.readBigUInt64LE(0));\n// Prints: 18446744069414584320n\n</code></pre>"
            },
            {
              "textRaw": "`buf.readBigUInt64LE([offset])`",
              "type": "method",
              "name": "readBigUInt64LE",
              "meta": {
                "added": [
                  "v12.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {bigint}",
                    "name": "return",
                    "type": "bigint"
                  },
                  "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`."
                    }
                  ]
                }
              ],
              "desc": "<p>Reads an unsigned 64-bit integer from <code>buf</code> at the specified <code>offset</code> with\nthe specified <a href=\"https://en.wikipedia.org/wiki/Endianness\">endianness</a> (<code>readBigUInt64BE()</code> reads as big endian,\n<code>readBigUInt64LE()</code> reads as little endian).</p>\n<pre><code class=\"language-js\">const buf = Buffer.from([0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff]);\n\nconsole.log(buf.readBigUInt64BE(0));\n// Prints: 4294967295n\n\nconsole.log(buf.readBigUInt64LE(0));\n// Prints: 18446744069414584320n\n</code></pre>"
            },
            {
              "textRaw": "`buf.readDoubleBE([offset])`",
              "type": "method",
              "name": "readDoubleBE",
              "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": [
                {
                  "return": {
                    "textRaw": "Returns: {number}",
                    "name": "return",
                    "type": "number"
                  },
                  "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`."
                    }
                  ]
                }
              ],
              "desc": "<p>Reads a 64-bit double from <code>buf</code> at the specified <code>offset</code> with the specified\n<a href=\"https://en.wikipedia.org/wiki/Endianness\">endianness</a> (<code>readDoubleBE()</code> reads as big endian, <code>readDoubleLE()</code> reads as\nlittle endian).</p>\n<pre><code class=\"language-js\">const buf = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8]);\n\nconsole.log(buf.readDoubleBE(0));\n// Prints: 8.20788039913184e-304\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.readDoubleLE([offset])`",
              "type": "method",
              "name": "readDoubleLE",
              "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": [
                {
                  "return": {
                    "textRaw": "Returns: {number}",
                    "name": "return",
                    "type": "number"
                  },
                  "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`."
                    }
                  ]
                }
              ],
              "desc": "<p>Reads a 64-bit double from <code>buf</code> at the specified <code>offset</code> with the specified\n<a href=\"https://en.wikipedia.org/wiki/Endianness\">endianness</a> (<code>readDoubleBE()</code> reads as big endian, <code>readDoubleLE()</code> reads as\nlittle endian).</p>\n<pre><code class=\"language-js\">const buf = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8]);\n\nconsole.log(buf.readDoubleBE(0));\n// Prints: 8.20788039913184e-304\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])`",
              "type": "method",
              "name": "readFloatBE",
              "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": [
                {
                  "return": {
                    "textRaw": "Returns: {number}",
                    "name": "return",
                    "type": "number"
                  },
                  "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`."
                    }
                  ]
                }
              ],
              "desc": "<p>Reads a 32-bit float from <code>buf</code> at the specified <code>offset</code> with the specified\n<a href=\"https://en.wikipedia.org/wiki/Endianness\">endianness</a> (<code>readFloatBE()</code> reads as big endian, <code>readFloatLE()</code> reads as\nlittle endian).</p>\n<pre><code class=\"language-js\">const buf = Buffer.from([1, 2, 3, 4]);\n\nconsole.log(buf.readFloatBE(0));\n// Prints: 2.387939260590663e-38\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.readFloatLE([offset])`",
              "type": "method",
              "name": "readFloatLE",
              "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": [
                {
                  "return": {
                    "textRaw": "Returns: {number}",
                    "name": "return",
                    "type": "number"
                  },
                  "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`."
                    }
                  ]
                }
              ],
              "desc": "<p>Reads a 32-bit float from <code>buf</code> at the specified <code>offset</code> with the specified\n<a href=\"https://en.wikipedia.org/wiki/Endianness\">endianness</a> (<code>readFloatBE()</code> reads as big endian, <code>readFloatLE()</code> reads as\nlittle endian).</p>\n<pre><code class=\"language-js\">const buf = Buffer.from([1, 2, 3, 4]);\n\nconsole.log(buf.readFloatBE(0));\n// Prints: 2.387939260590663e-38\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])`",
              "type": "method",
              "name": "readInt8",
              "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": [
                {
                  "return": {
                    "textRaw": "Returns: {integer}",
                    "name": "return",
                    "type": "integer"
                  },
                  "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`."
                    }
                  ]
                }
              ],
              "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-js\">const 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])`",
              "type": "method",
              "name": "readInt16BE",
              "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": [
                {
                  "return": {
                    "textRaw": "Returns: {integer}",
                    "name": "return",
                    "type": "integer"
                  },
                  "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`."
                    }
                  ]
                }
              ],
              "desc": "<p>Reads a signed 16-bit integer from <code>buf</code> at the specified <code>offset</code> with\nthe specified <a href=\"https://en.wikipedia.org/wiki/Endianness\">endianness</a> (<code>readInt16BE()</code> reads as big endian,\n<code>readInt16LE()</code> reads as little endian).</p>\n<p>Integers read from a <code>Buffer</code> are interpreted as two's complement signed values.</p>\n<pre><code class=\"language-js\">const buf = Buffer.from([0, 5]);\n\nconsole.log(buf.readInt16BE(0));\n// Prints: 5\nconsole.log(buf.readInt16LE(0));\n// Prints: 1280\nconsole.log(buf.readInt16LE(1));\n// Throws ERR_OUT_OF_RANGE.\n</code></pre>"
            },
            {
              "textRaw": "`buf.readInt16LE([offset])`",
              "type": "method",
              "name": "readInt16LE",
              "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": [
                {
                  "return": {
                    "textRaw": "Returns: {integer}",
                    "name": "return",
                    "type": "integer"
                  },
                  "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`."
                    }
                  ]
                }
              ],
              "desc": "<p>Reads a signed 16-bit integer from <code>buf</code> at the specified <code>offset</code> with\nthe specified <a href=\"https://en.wikipedia.org/wiki/Endianness\">endianness</a> (<code>readInt16BE()</code> reads as big endian,\n<code>readInt16LE()</code> reads as little endian).</p>\n<p>Integers read from a <code>Buffer</code> are interpreted as two's complement signed values.</p>\n<pre><code class=\"language-js\">const buf = Buffer.from([0, 5]);\n\nconsole.log(buf.readInt16BE(0));\n// Prints: 5\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])`",
              "type": "method",
              "name": "readInt32BE",
              "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": [
                {
                  "return": {
                    "textRaw": "Returns: {integer}",
                    "name": "return",
                    "type": "integer"
                  },
                  "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`."
                    }
                  ]
                }
              ],
              "desc": "<p>Reads a signed 32-bit integer from <code>buf</code> at the specified <code>offset</code> with\nthe specified <a href=\"https://en.wikipedia.org/wiki/Endianness\">endianness</a> (<code>readInt32BE()</code> reads as big endian,\n<code>readInt32LE()</code> reads as little endian).</p>\n<p>Integers read from a <code>Buffer</code> are interpreted as two's complement signed values.</p>\n<pre><code class=\"language-js\">const buf = Buffer.from([0, 0, 0, 5]);\n\nconsole.log(buf.readInt32BE(0));\n// Prints: 5\nconsole.log(buf.readInt32LE(0));\n// Prints: 83886080\nconsole.log(buf.readInt32LE(1));\n// Throws ERR_OUT_OF_RANGE.\n</code></pre>"
            },
            {
              "textRaw": "`buf.readInt32LE([offset])`",
              "type": "method",
              "name": "readInt32LE",
              "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": [
                {
                  "return": {
                    "textRaw": "Returns: {integer}",
                    "name": "return",
                    "type": "integer"
                  },
                  "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`."
                    }
                  ]
                }
              ],
              "desc": "<p>Reads a signed 32-bit integer from <code>buf</code> at the specified <code>offset</code> with\nthe specified <a href=\"https://en.wikipedia.org/wiki/Endianness\">endianness</a> (<code>readInt32BE()</code> reads as big endian,\n<code>readInt32LE()</code> reads as little endian).</p>\n<p>Integers read from a <code>Buffer</code> are interpreted as two's complement signed values.</p>\n<pre><code class=\"language-js\">const buf = Buffer.from([0, 0, 0, 5]);\n\nconsole.log(buf.readInt32BE(0));\n// Prints: 5\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)`",
              "type": "method",
              "name": "readIntBE",
              "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": [
                {
                  "return": {
                    "textRaw": "Returns: {integer}",
                    "name": "return",
                    "type": "integer"
                  },
                  "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`."
                    }
                  ]
                }
              ],
              "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 two's complement signed value. Supports up to 48\nbits of accuracy.</p>\n<pre><code class=\"language-js\">const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]);\n\nconsole.log(buf.readIntLE(0, 6).toString(16));\n// Prints: -546f87a9cbee\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)`",
              "type": "method",
              "name": "readIntLE",
              "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": [
                {
                  "return": {
                    "textRaw": "Returns: {integer}",
                    "name": "return",
                    "type": "integer"
                  },
                  "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`."
                    }
                  ]
                }
              ],
              "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 two's complement signed value. Supports up to 48\nbits of accuracy.</p>\n<pre><code class=\"language-js\">const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]);\n\nconsole.log(buf.readIntLE(0, 6).toString(16));\n// Prints: -546f87a9cbee\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.readUInt8([offset])`",
              "type": "method",
              "name": "readUInt8",
              "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": [
                {
                  "return": {
                    "textRaw": "Returns: {integer}",
                    "name": "return",
                    "type": "integer"
                  },
                  "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`."
                    }
                  ]
                }
              ],
              "desc": "<p>Reads an unsigned 8-bit integer from <code>buf</code> at the specified <code>offset</code>.</p>\n<pre><code class=\"language-js\">const 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])`",
              "type": "method",
              "name": "readUInt16BE",
              "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": [
                {
                  "return": {
                    "textRaw": "Returns: {integer}",
                    "name": "return",
                    "type": "integer"
                  },
                  "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`."
                    }
                  ]
                }
              ],
              "desc": "<p>Reads an unsigned 16-bit integer from <code>buf</code> at the specified <code>offset</code> with\nthe specified <a href=\"https://en.wikipedia.org/wiki/Endianness\">endianness</a> (<code>readUInt16BE()</code> reads as big endian, <code>readUInt16LE()</code>\nreads as little endian).</p>\n<pre><code class=\"language-js\">const buf = Buffer.from([0x12, 0x34, 0x56]);\n\nconsole.log(buf.readUInt16BE(0).toString(16));\n// Prints: 1234\nconsole.log(buf.readUInt16LE(0).toString(16));\n// Prints: 3412\nconsole.log(buf.readUInt16BE(1).toString(16));\n// Prints: 3456\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.readUInt16LE([offset])`",
              "type": "method",
              "name": "readUInt16LE",
              "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": [
                {
                  "return": {
                    "textRaw": "Returns: {integer}",
                    "name": "return",
                    "type": "integer"
                  },
                  "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`."
                    }
                  ]
                }
              ],
              "desc": "<p>Reads an unsigned 16-bit integer from <code>buf</code> at the specified <code>offset</code> with\nthe specified <a href=\"https://en.wikipedia.org/wiki/Endianness\">endianness</a> (<code>readUInt16BE()</code> reads as big endian, <code>readUInt16LE()</code>\nreads as little endian).</p>\n<pre><code class=\"language-js\">const buf = Buffer.from([0x12, 0x34, 0x56]);\n\nconsole.log(buf.readUInt16BE(0).toString(16));\n// Prints: 1234\nconsole.log(buf.readUInt16LE(0).toString(16));\n// Prints: 3412\nconsole.log(buf.readUInt16BE(1).toString(16));\n// Prints: 3456\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])`",
              "type": "method",
              "name": "readUInt32BE",
              "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": [
                {
                  "return": {
                    "textRaw": "Returns: {integer}",
                    "name": "return",
                    "type": "integer"
                  },
                  "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`."
                    }
                  ]
                }
              ],
              "desc": "<p>Reads an unsigned 32-bit integer from <code>buf</code> at the specified <code>offset</code> with\nthe specified <a href=\"https://en.wikipedia.org/wiki/Endianness\">endianness</a> (<code>readUInt32BE()</code> reads as big endian,\n<code>readUInt32LE()</code> reads as little endian).</p>\n<pre><code class=\"language-js\">const buf = Buffer.from([0x12, 0x34, 0x56, 0x78]);\n\nconsole.log(buf.readUInt32BE(0).toString(16));\n// Prints: 12345678\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.readUInt32LE([offset])`",
              "type": "method",
              "name": "readUInt32LE",
              "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": [
                {
                  "return": {
                    "textRaw": "Returns: {integer}",
                    "name": "return",
                    "type": "integer"
                  },
                  "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`."
                    }
                  ]
                }
              ],
              "desc": "<p>Reads an unsigned 32-bit integer from <code>buf</code> at the specified <code>offset</code> with\nthe specified <a href=\"https://en.wikipedia.org/wiki/Endianness\">endianness</a> (<code>readUInt32BE()</code> reads as big endian,\n<code>readUInt32LE()</code> reads as little endian).</p>\n<pre><code class=\"language-js\">const buf = Buffer.from([0x12, 0x34, 0x56, 0x78]);\n\nconsole.log(buf.readUInt32BE(0).toString(16));\n// Prints: 12345678\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)`",
              "type": "method",
              "name": "readUIntBE",
              "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": [
                {
                  "return": {
                    "textRaw": "Returns: {integer}",
                    "name": "return",
                    "type": "integer"
                  },
                  "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`."
                    }
                  ]
                }
              ],
              "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 integer. Supports up to 48\nbits of accuracy.</p>\n<pre><code class=\"language-js\">const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]);\n\nconsole.log(buf.readUIntBE(0, 6).toString(16));\n// Prints: 1234567890ab\nconsole.log(buf.readUIntLE(0, 6).toString(16));\n// Prints: ab9078563412\nconsole.log(buf.readUIntBE(1, 6).toString(16));\n// Throws ERR_OUT_OF_RANGE.\n</code></pre>"
            },
            {
              "textRaw": "`buf.readUIntLE(offset, byteLength)`",
              "type": "method",
              "name": "readUIntLE",
              "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": [
                {
                  "return": {
                    "textRaw": "Returns: {integer}",
                    "name": "return",
                    "type": "integer"
                  },
                  "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`."
                    }
                  ]
                }
              ],
              "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 integer. Supports up to 48\nbits of accuracy.</p>\n<pre><code class=\"language-js\">const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]);\n\nconsole.log(buf.readUIntBE(0, 6).toString(16));\n// Prints: 1234567890ab\nconsole.log(buf.readUIntLE(0, 6).toString(16));\n// Prints: ab9078563412\nconsole.log(buf.readUIntBE(1, 6).toString(16));\n// Throws ERR_OUT_OF_RANGE.\n</code></pre>"
            },
            {
              "textRaw": "`buf.subarray([start[, end]])`",
              "type": "method",
              "name": "subarray",
              "meta": {
                "added": [
                  "v3.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Buffer}",
                    "name": "return",
                    "type": "Buffer"
                  },
                  "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."
                    },
                    {
                      "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)."
                    }
                  ]
                }
              ],
              "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> indices.</p>\n<p>Specifying <code>end</code> greater than <a href=\"buffer.html#buffer_buf_length\"><code>buf.length</code></a> will return the same result as\nthat of <code>end</code> equal to <a href=\"buffer.html#buffer_buf_length\"><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#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-js\">// 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-js\">const 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]])`",
              "type": "method",
              "name": "slice",
              "meta": {
                "added": [
                  "v0.3.0"
                ],
                "changes": [
                  {
                    "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."
                  }
                ]
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Buffer}",
                    "name": "return",
                    "type": "Buffer"
                  },
                  "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."
                    },
                    {
                      "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)."
                    }
                  ]
                }
              ],
              "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> indices.</p>\n<p>This is the same behavior as <code>buf.subarray()</code>.</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-js\">const 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</code></pre>"
            },
            {
              "textRaw": "`buf.swap16()`",
              "type": "method",
              "name": "swap16",
              "meta": {
                "added": [
                  "v5.10.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Buffer} A reference to `buf`.",
                    "name": "return",
                    "type": "Buffer",
                    "desc": "A reference to `buf`."
                  },
                  "params": []
                }
              ],
              "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=\"buffer.html#buffer_buf_length\"><code>buf.length</code></a>\nis not a multiple of 2.</p>\n<pre><code class=\"language-js\">const 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-js\">const 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()`",
              "type": "method",
              "name": "swap32",
              "meta": {
                "added": [
                  "v5.10.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Buffer} A reference to `buf`.",
                    "name": "return",
                    "type": "Buffer",
                    "desc": "A reference to `buf`."
                  },
                  "params": []
                }
              ],
              "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=\"buffer.html#buffer_buf_length\"><code>buf.length</code></a>\nis not a multiple of 4.</p>\n<pre><code class=\"language-js\">const 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()`",
              "type": "method",
              "name": "swap64",
              "meta": {
                "added": [
                  "v6.3.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Buffer} A reference to `buf`.",
                    "name": "return",
                    "type": "Buffer",
                    "desc": "A reference to `buf`."
                  },
                  "params": []
                }
              ],
              "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=\"buffer.html#buffer_buf_length\"><code>buf.length</code></a> is not a multiple of 8.</p>\n<pre><code class=\"language-js\">const 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()`",
              "type": "method",
              "name": "toJSON",
              "meta": {
                "added": [
                  "v0.9.2"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Object}",
                    "name": "return",
                    "type": "Object"
                  },
                  "params": []
                }
              ],
              "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-js\">const 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]]])`",
              "type": "method",
              "name": "toString",
              "meta": {
                "added": [
                  "v0.1.90"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {string}",
                    "name": "return",
                    "type": "string"
                  },
                  "params": [
                    {
                      "textRaw": "`encoding` {string} The character encoding to use. **Default:** `'utf8'`.",
                      "name": "encoding",
                      "type": "string",
                      "default": "`'utf8'`",
                      "desc": "The character encoding to use."
                    },
                    {
                      "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."
                    },
                    {
                      "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)."
                    }
                  ]
                }
              ],
              "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=\"buffer.html#buffer_buffer_constants_max_string_length\"><code>buffer.constants.MAX_STRING_LENGTH</code></a>.</p>\n<pre><code class=\"language-js\">const 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()`",
              "type": "method",
              "name": "values",
              "meta": {
                "added": [
                  "v1.1.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Iterator}",
                    "name": "return",
                    "type": "Iterator"
                  },
                  "params": []
                }
              ],
              "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-js\">const 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])`",
              "type": "method",
              "name": "write",
              "meta": {
                "added": [
                  "v0.1.90"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {integer} Number of bytes written.",
                    "name": "return",
                    "type": "integer",
                    "desc": "Number of bytes written."
                  },
                  "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`."
                    },
                    {
                      "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`)."
                    },
                    {
                      "textRaw": "`encoding` {string} The character encoding of `string`. **Default:** `'utf8'`.",
                      "name": "encoding",
                      "type": "string",
                      "default": "`'utf8'`",
                      "desc": "The character encoding of `string`."
                    }
                  ]
                }
              ],
              "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-js\">const 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])`",
              "type": "method",
              "name": "writeBigInt64BE",
              "meta": {
                "added": [
                  "v12.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {integer} `offset` plus the number of bytes written.",
                    "name": "return",
                    "type": "integer",
                    "desc": "`offset` plus the number of bytes written."
                  },
                  "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`."
                    }
                  ]
                }
              ],
              "desc": "<p>Writes <code>value</code> to <code>buf</code> at the specified <code>offset</code> with the specified\n<a href=\"https://en.wikipedia.org/wiki/Endianness\">endianness</a> (<code>writeBigInt64BE()</code> writes as big endian, <code>writeBigInt64LE()</code>\nwrites 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-js\">const 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])`",
              "type": "method",
              "name": "writeBigInt64LE",
              "meta": {
                "added": [
                  "v12.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {integer} `offset` plus the number of bytes written.",
                    "name": "return",
                    "type": "integer",
                    "desc": "`offset` plus the number of bytes written."
                  },
                  "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`."
                    }
                  ]
                }
              ],
              "desc": "<p>Writes <code>value</code> to <code>buf</code> at the specified <code>offset</code> with the specified\n<a href=\"https://en.wikipedia.org/wiki/Endianness\">endianness</a> (<code>writeBigInt64BE()</code> writes as big endian, <code>writeBigInt64LE()</code>\nwrites 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-js\">const 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.writeBigUInt64BE(value[, offset])`",
              "type": "method",
              "name": "writeBigUInt64BE",
              "meta": {
                "added": [
                  "v12.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {integer} `offset` plus the number of bytes written.",
                    "name": "return",
                    "type": "integer",
                    "desc": "`offset` plus the number of bytes written."
                  },
                  "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`."
                    }
                  ]
                }
              ],
              "desc": "<p>Writes <code>value</code> to <code>buf</code> at the specified <code>offset</code> with specified <a href=\"https://en.wikipedia.org/wiki/Endianness\">endianness</a>\n(<code>writeBigUInt64BE()</code> writes as big endian, <code>writeBigUInt64LE()</code> writes as\nlittle endian).</p>\n<pre><code class=\"language-js\">const 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>"
            },
            {
              "textRaw": "`buf.writeBigUInt64LE(value[, offset])`",
              "type": "method",
              "name": "writeBigUInt64LE",
              "meta": {
                "added": [
                  "v12.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {integer} `offset` plus the number of bytes written.",
                    "name": "return",
                    "type": "integer",
                    "desc": "`offset` plus the number of bytes written."
                  },
                  "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`."
                    }
                  ]
                }
              ],
              "desc": "<p>Writes <code>value</code> to <code>buf</code> at the specified <code>offset</code> with specified <a href=\"https://en.wikipedia.org/wiki/Endianness\">endianness</a>\n(<code>writeBigUInt64BE()</code> writes as big endian, <code>writeBigUInt64LE()</code> writes as\nlittle endian).</p>\n<pre><code class=\"language-js\">const 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>"
            },
            {
              "textRaw": "`buf.writeDoubleBE(value[, offset])`",
              "type": "method",
              "name": "writeDoubleBE",
              "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": [
                {
                  "return": {
                    "textRaw": "Returns: {integer} `offset` plus the number of bytes written.",
                    "name": "return",
                    "type": "integer",
                    "desc": "`offset` plus the number of bytes written."
                  },
                  "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`."
                    }
                  ]
                }
              ],
              "desc": "<p>Writes <code>value</code> to <code>buf</code> at the specified <code>offset</code> with the specified\n<a href=\"https://en.wikipedia.org/wiki/Endianness\">endianness</a> (<code>writeDoubleBE()</code> writes as big endian, <code>writeDoubleLE()</code> writes\nas little endian). <code>value</code> must be a JavaScript number. Behavior is undefined\nwhen <code>value</code> is anything other than a JavaScript number.</p>\n<pre><code class=\"language-js\">const 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\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.writeDoubleLE(value[, offset])`",
              "type": "method",
              "name": "writeDoubleLE",
              "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": [
                {
                  "return": {
                    "textRaw": "Returns: {integer} `offset` plus the number of bytes written.",
                    "name": "return",
                    "type": "integer",
                    "desc": "`offset` plus the number of bytes written."
                  },
                  "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`."
                    }
                  ]
                }
              ],
              "desc": "<p>Writes <code>value</code> to <code>buf</code> at the specified <code>offset</code> with the specified\n<a href=\"https://en.wikipedia.org/wiki/Endianness\">endianness</a> (<code>writeDoubleBE()</code> writes as big endian, <code>writeDoubleLE()</code> writes\nas little endian). <code>value</code> must be a JavaScript number. Behavior is undefined\nwhen <code>value</code> is anything other than a JavaScript number.</p>\n<pre><code class=\"language-js\">const 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\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])`",
              "type": "method",
              "name": "writeFloatBE",
              "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": [
                {
                  "return": {
                    "textRaw": "Returns: {integer} `offset` plus the number of bytes written.",
                    "name": "return",
                    "type": "integer",
                    "desc": "`offset` plus the number of bytes written."
                  },
                  "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`."
                    }
                  ]
                }
              ],
              "desc": "<p>Writes <code>value</code> to <code>buf</code> at the specified <code>offset</code> with specified <a href=\"https://en.wikipedia.org/wiki/Endianness\">endianness</a>\n(<code>writeFloatBE()</code> writes as big endian, <code>writeFloatLE()</code> writes as little\nendian). <code>value</code> must be a JavaScript number. Behavior is undefined when\n<code>value</code> is anything other than a JavaScript number.</p>\n<pre><code class=\"language-js\">const buf = Buffer.allocUnsafe(4);\n\nbuf.writeFloatBE(0xcafebabe, 0);\n\nconsole.log(buf);\n// Prints: &#x3C;Buffer 4f 4a fe bb>\n\nbuf.writeFloatLE(0xcafebabe, 0);\n\nconsole.log(buf);\n// Prints: &#x3C;Buffer bb fe 4a 4f>\n</code></pre>"
            },
            {
              "textRaw": "`buf.writeFloatLE(value[, offset])`",
              "type": "method",
              "name": "writeFloatLE",
              "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": [
                {
                  "return": {
                    "textRaw": "Returns: {integer} `offset` plus the number of bytes written.",
                    "name": "return",
                    "type": "integer",
                    "desc": "`offset` plus the number of bytes written."
                  },
                  "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`."
                    }
                  ]
                }
              ],
              "desc": "<p>Writes <code>value</code> to <code>buf</code> at the specified <code>offset</code> with specified <a href=\"https://en.wikipedia.org/wiki/Endianness\">endianness</a>\n(<code>writeFloatBE()</code> writes as big endian, <code>writeFloatLE()</code> writes as little\nendian). <code>value</code> must be a JavaScript number. Behavior is undefined when\n<code>value</code> is anything other than a JavaScript number.</p>\n<pre><code class=\"language-js\">const buf = Buffer.allocUnsafe(4);\n\nbuf.writeFloatBE(0xcafebabe, 0);\n\nconsole.log(buf);\n// Prints: &#x3C;Buffer 4f 4a fe bb>\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])`",
              "type": "method",
              "name": "writeInt8",
              "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": [
                {
                  "return": {
                    "textRaw": "Returns: {integer} `offset` plus the number of bytes written.",
                    "name": "return",
                    "type": "integer",
                    "desc": "`offset` plus the number of bytes written."
                  },
                  "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`."
                    }
                  ]
                }
              ],
              "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-js\">const 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])`",
              "type": "method",
              "name": "writeInt16BE",
              "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": [
                {
                  "return": {
                    "textRaw": "Returns: {integer} `offset` plus the number of bytes written.",
                    "name": "return",
                    "type": "integer",
                    "desc": "`offset` plus the number of bytes written."
                  },
                  "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`."
                    }
                  ]
                }
              ],
              "desc": "<p>Writes <code>value</code> to <code>buf</code> at the specified <code>offset</code> with the specified\n<a href=\"https://en.wikipedia.org/wiki/Endianness\">endianness</a> (<code>writeInt16BE()</code> writes as big endian, <code>writeInt16LE()</code> writes\nas little endian). <code>value</code> must be a valid signed 16-bit integer. Behavior is\nundefined when <code>value</code> is anything other than a signed 16-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-js\">const buf = Buffer.allocUnsafe(4);\n\nbuf.writeInt16BE(0x0102, 0);\nbuf.writeInt16LE(0x0304, 2);\n\nconsole.log(buf);\n// Prints: &#x3C;Buffer 01 02 04 03>\n</code></pre>"
            },
            {
              "textRaw": "`buf.writeInt16LE(value[, offset])`",
              "type": "method",
              "name": "writeInt16LE",
              "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": [
                {
                  "return": {
                    "textRaw": "Returns: {integer} `offset` plus the number of bytes written.",
                    "name": "return",
                    "type": "integer",
                    "desc": "`offset` plus the number of bytes written."
                  },
                  "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`."
                    }
                  ]
                }
              ],
              "desc": "<p>Writes <code>value</code> to <code>buf</code> at the specified <code>offset</code> with the specified\n<a href=\"https://en.wikipedia.org/wiki/Endianness\">endianness</a> (<code>writeInt16BE()</code> writes as big endian, <code>writeInt16LE()</code> writes\nas little endian). <code>value</code> must be a valid signed 16-bit integer. Behavior is\nundefined when <code>value</code> is anything other than a signed 16-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-js\">const buf = Buffer.allocUnsafe(4);\n\nbuf.writeInt16BE(0x0102, 0);\nbuf.writeInt16LE(0x0304, 2);\n\nconsole.log(buf);\n// Prints: &#x3C;Buffer 01 02 04 03>\n</code></pre>"
            },
            {
              "textRaw": "`buf.writeInt32BE(value[, offset])`",
              "type": "method",
              "name": "writeInt32BE",
              "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": [
                {
                  "return": {
                    "textRaw": "Returns: {integer} `offset` plus the number of bytes written.",
                    "name": "return",
                    "type": "integer",
                    "desc": "`offset` plus the number of bytes written."
                  },
                  "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`."
                    }
                  ]
                }
              ],
              "desc": "<p>Writes <code>value</code> to <code>buf</code> at the specified <code>offset</code> with the specified\n<a href=\"https://en.wikipedia.org/wiki/Endianness\">endianness</a> (<code>writeInt32BE()</code> writes aS big endian, <code>writeInt32LE()</code> writes\nas little endian). <code>value</code> must be a valid signed 32-bit integer. Behavior is\nundefined when <code>value</code> is anything other than a signed 32-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-js\">const buf = Buffer.allocUnsafe(8);\n\nbuf.writeInt32BE(0x01020304, 0);\nbuf.writeInt32LE(0x05060708, 4);\n\nconsole.log(buf);\n// Prints: &#x3C;Buffer 01 02 03 04 08 07 06 05>\n</code></pre>"
            },
            {
              "textRaw": "`buf.writeInt32LE(value[, offset])`",
              "type": "method",
              "name": "writeInt32LE",
              "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": [
                {
                  "return": {
                    "textRaw": "Returns: {integer} `offset` plus the number of bytes written.",
                    "name": "return",
                    "type": "integer",
                    "desc": "`offset` plus the number of bytes written."
                  },
                  "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`."
                    }
                  ]
                }
              ],
              "desc": "<p>Writes <code>value</code> to <code>buf</code> at the specified <code>offset</code> with the specified\n<a href=\"https://en.wikipedia.org/wiki/Endianness\">endianness</a> (<code>writeInt32BE()</code> writes aS big endian, <code>writeInt32LE()</code> writes\nas little endian). <code>value</code> must be a valid signed 32-bit integer. Behavior is\nundefined when <code>value</code> is anything other than a signed 32-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-js\">const buf = Buffer.allocUnsafe(8);\n\nbuf.writeInt32BE(0x01020304, 0);\nbuf.writeInt32LE(0x05060708, 4);\n\nconsole.log(buf);\n// Prints: &#x3C;Buffer 01 02 03 04 08 07 06 05>\n</code></pre>"
            },
            {
              "textRaw": "`buf.writeIntBE(value, offset, byteLength)`",
              "type": "method",
              "name": "writeIntBE",
              "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": [
                {
                  "return": {
                    "textRaw": "Returns: {integer} `offset` plus the number of bytes written.",
                    "name": "return",
                    "type": "integer",
                    "desc": "`offset` plus the number of bytes written."
                  },
                  "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`."
                    }
                  ]
                }
              ],
              "desc": "<p>Writes <code>byteLength</code> bytes of <code>value</code> to <code>buf</code> at the specified <code>offset</code>.\nSupports up to 48 bits of accuracy. Behavior is undefined when <code>value</code> is\nanything other than a signed integer.</p>\n<pre><code class=\"language-js\">const 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\nbuf.writeIntLE(0x1234567890ab, 0, 6);\n\nconsole.log(buf);\n// Prints: &#x3C;Buffer ab 90 78 56 34 12>\n</code></pre>"
            },
            {
              "textRaw": "`buf.writeIntLE(value, offset, byteLength)`",
              "type": "method",
              "name": "writeIntLE",
              "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": [
                {
                  "return": {
                    "textRaw": "Returns: {integer} `offset` plus the number of bytes written.",
                    "name": "return",
                    "type": "integer",
                    "desc": "`offset` plus the number of bytes written."
                  },
                  "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`."
                    }
                  ]
                }
              ],
              "desc": "<p>Writes <code>byteLength</code> bytes of <code>value</code> to <code>buf</code> at the specified <code>offset</code>.\nSupports up to 48 bits of accuracy. Behavior is undefined when <code>value</code> is\nanything other than a signed integer.</p>\n<pre><code class=\"language-js\">const 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\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])`",
              "type": "method",
              "name": "writeUInt8",
              "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": [
                {
                  "return": {
                    "textRaw": "Returns: {integer} `offset` plus the number of bytes written.",
                    "name": "return",
                    "type": "integer",
                    "desc": "`offset` plus the number of bytes written."
                  },
                  "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`."
                    }
                  ]
                }
              ],
              "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<pre><code class=\"language-js\">const 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])`",
              "type": "method",
              "name": "writeUInt16BE",
              "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": [
                {
                  "return": {
                    "textRaw": "Returns: {integer} `offset` plus the number of bytes written.",
                    "name": "return",
                    "type": "integer",
                    "desc": "`offset` plus the number of bytes written."
                  },
                  "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`."
                    }
                  ]
                }
              ],
              "desc": "<p>Writes <code>value</code> to <code>buf</code> at the specified <code>offset</code> with the specified\n<a href=\"https://en.wikipedia.org/wiki/Endianness\">endianness</a> (<code>writeUInt16BE()</code> writes as big endian, <code>writeUInt16LE()</code> writes\nas little endian). <code>value</code> must be a valid unsigned 16-bit integer. Behavior is\nundefined when <code>value</code> is anything other than an unsigned 16-bit integer.</p>\n<pre><code class=\"language-js\">const 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\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.writeUInt16LE(value[, offset])`",
              "type": "method",
              "name": "writeUInt16LE",
              "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": [
                {
                  "return": {
                    "textRaw": "Returns: {integer} `offset` plus the number of bytes written.",
                    "name": "return",
                    "type": "integer",
                    "desc": "`offset` plus the number of bytes written."
                  },
                  "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`."
                    }
                  ]
                }
              ],
              "desc": "<p>Writes <code>value</code> to <code>buf</code> at the specified <code>offset</code> with the specified\n<a href=\"https://en.wikipedia.org/wiki/Endianness\">endianness</a> (<code>writeUInt16BE()</code> writes as big endian, <code>writeUInt16LE()</code> writes\nas little endian). <code>value</code> must be a valid unsigned 16-bit integer. Behavior is\nundefined when <code>value</code> is anything other than an unsigned 16-bit integer.</p>\n<pre><code class=\"language-js\">const 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\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])`",
              "type": "method",
              "name": "writeUInt32BE",
              "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": [
                {
                  "return": {
                    "textRaw": "Returns: {integer} `offset` plus the number of bytes written.",
                    "name": "return",
                    "type": "integer",
                    "desc": "`offset` plus the number of bytes written."
                  },
                  "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`."
                    }
                  ]
                }
              ],
              "desc": "<p>Writes <code>value</code> to <code>buf</code> at the specified <code>offset</code> with the specified\n<a href=\"https://en.wikipedia.org/wiki/Endianness\">endianness</a> (<code>writeUInt32BE()</code> writes as big endian, <code>writeUInt32LE()</code> writes\nas little endian). <code>value</code> must be a valid unsigned 32-bit integer. Behavior is\nundefined when <code>value</code> is anything other than an unsigned 32-bit integer.</p>\n<pre><code class=\"language-js\">const buf = Buffer.allocUnsafe(4);\n\nbuf.writeUInt32BE(0xfeedface, 0);\n\nconsole.log(buf);\n// Prints: &#x3C;Buffer fe ed fa ce>\n\nbuf.writeUInt32LE(0xfeedface, 0);\n\nconsole.log(buf);\n// Prints: &#x3C;Buffer ce fa ed fe>\n</code></pre>"
            },
            {
              "textRaw": "`buf.writeUInt32LE(value[, offset])`",
              "type": "method",
              "name": "writeUInt32LE",
              "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": [
                {
                  "return": {
                    "textRaw": "Returns: {integer} `offset` plus the number of bytes written.",
                    "name": "return",
                    "type": "integer",
                    "desc": "`offset` plus the number of bytes written."
                  },
                  "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`."
                    }
                  ]
                }
              ],
              "desc": "<p>Writes <code>value</code> to <code>buf</code> at the specified <code>offset</code> with the specified\n<a href=\"https://en.wikipedia.org/wiki/Endianness\">endianness</a> (<code>writeUInt32BE()</code> writes as big endian, <code>writeUInt32LE()</code> writes\nas little endian). <code>value</code> must be a valid unsigned 32-bit integer. Behavior is\nundefined when <code>value</code> is anything other than an unsigned 32-bit integer.</p>\n<pre><code class=\"language-js\">const buf = Buffer.allocUnsafe(4);\n\nbuf.writeUInt32BE(0xfeedface, 0);\n\nconsole.log(buf);\n// Prints: &#x3C;Buffer fe ed fa ce>\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)`",
              "type": "method",
              "name": "writeUIntBE",
              "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 and `byteLength` to `uint32` anymore."
                  }
                ]
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {integer} `offset` plus the number of bytes written.",
                    "name": "return",
                    "type": "integer",
                    "desc": "`offset` plus the number of bytes written."
                  },
                  "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`."
                    }
                  ]
                }
              ],
              "desc": "<p>Writes <code>byteLength</code> bytes of <code>value</code> to <code>buf</code> at the specified <code>offset</code>.\nSupports up to 48 bits of accuracy. Behavior is undefined when <code>value</code> is\nanything other than an unsigned integer.</p>\n<pre><code class=\"language-js\">const 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\nbuf.writeUIntLE(0x1234567890ab, 0, 6);\n\nconsole.log(buf);\n// Prints: &#x3C;Buffer ab 90 78 56 34 12>\n</code></pre>"
            },
            {
              "textRaw": "`buf.writeUIntLE(value, offset, byteLength)`",
              "type": "method",
              "name": "writeUIntLE",
              "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 and `byteLength` to `uint32` anymore."
                  }
                ]
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {integer} `offset` plus the number of bytes written.",
                    "name": "return",
                    "type": "integer",
                    "desc": "`offset` plus the number of bytes written."
                  },
                  "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`."
                    }
                  ]
                }
              ],
              "desc": "<p>Writes <code>byteLength</code> bytes of <code>value</code> to <code>buf</code> at the specified <code>offset</code>.\nSupports up to 48 bits of accuracy. Behavior is undefined when <code>value</code> is\nanything other than an unsigned integer.</p>\n<pre><code class=\"language-js\">const 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\nbuf.writeUIntLE(0x1234567890ab, 0, 6);\n\nconsole.log(buf);\n// Prints: &#x3C;Buffer ab 90 78 56 34 12>\n</code></pre>"
            }
          ],
          "signatures": [
            {
              "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=\"buffer.html#buffer_class_method_buffer_from_array\"><code>Buffer.from(array)</code></a>.</p>"
            },
            {
              "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."
                },
                {
                  "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."
                }
              ],
              "desc": "<p>See\n<a href=\"buffer.html#buffer_class_method_buffer_from_arraybuffer_byteoffset_length\"><code>Buffer.from(arrayBuffer[, byteOffset[, length]])</code></a>.</p>"
            },
            {
              "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=\"buffer.html#buffer_class_method_buffer_from_buffer\"><code>Buffer.from(buffer)</code></a>.</p>"
            },
            {
              "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=\"buffer.html#buffer_class_method_buffer_alloc_size_fill_encoding\"><code>Buffer.alloc()</code></a> and <a href=\"buffer.html#buffer_class_method_buffer_allocunsafe_size\"><code>Buffer.allocUnsafe()</code></a>. This variant of the\nconstructor is equivalent to <a href=\"buffer.html#buffer_class_method_buffer_alloc_size_fill_encoding\"><code>Buffer.alloc()</code></a>.</p>"
            },
            {
              "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`."
                }
              ],
              "desc": "<p>See <a href=\"buffer.html#buffer_class_method_buffer_from_string_encoding\"><code>Buffer.from(string[, encoding])</code></a>.</p>"
            }
          ]
        },
        {
          "textRaw": "Class: `SlowBuffer`",
          "type": "class",
          "name": "SlowBuffer",
          "meta": {
            "deprecated": [
              "v6.0.0"
            ],
            "changes": []
          },
          "stability": 0,
          "stabilityText": "Deprecated: Use [`Buffer.allocUnsafeSlow()`][] instead.",
          "desc": "<p>See <a href=\"buffer.html#buffer_class_method_buffer_allocunsafeslow_size\"><code>Buffer.allocUnsafeSlow()</code></a>. This was never a class in the sense that\nthe constructor always returned a <code>Buffer</code> instance, rather than a <code>SlowBuffer</code>\ninstance.</p>",
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`size` {integer} The desired length of the new `SlowBuffer`.",
                  "name": "size",
                  "type": "integer",
                  "desc": "The desired length of the new `SlowBuffer`."
                }
              ],
              "desc": "<p>See <a href=\"buffer.html#buffer_class_method_buffer_allocunsafeslow_size\"><code>Buffer.allocUnsafeSlow()</code></a>.</p>"
            }
          ]
        }
      ],
      "properties": [
        {
          "textRaw": "`INSPECT_MAX_BYTES` {integer} **Default:** `50`",
          "type": "integer",
          "name": "INSPECT_MAX_BYTES",
          "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#util_util_inspect_object_options\"><code>util.inspect()</code></a> for more details on <code>buf.inspect()</code> behavior.</p>\n<p>This is a property on the <code>buffer</code> module returned by\n<code>require('buffer')</code>, not on the <code>Buffer</code> global or a <code>Buffer</code> instance.</p>"
        },
        {
          "textRaw": "`kMaxLength` {integer} The largest size allowed for a single `Buffer` instance.",
          "type": "integer",
          "name": "kMaxLength",
          "meta": {
            "added": [
              "v3.0.0"
            ],
            "changes": []
          },
          "desc": "<p>An alias for <a href=\"buffer.html#buffer_buffer_constants_max_length\"><code>buffer.constants.MAX_LENGTH</code></a>.</p>\n<p>This is a property on the <code>buffer</code> module returned by\n<code>require('buffer')</code>, not on the <code>Buffer</code> global or a <code>Buffer</code> instance.</p>",
          "shortDesc": "The largest size allowed for a single `Buffer` instance."
        }
      ],
      "methods": [
        {
          "textRaw": "`buffer.transcode(source, fromEnc, toEnc)`",
          "type": "method",
          "name": "transcode",
          "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": [
            {
              "return": {
                "textRaw": "Returns: {Buffer}",
                "name": "return",
                "type": "Buffer"
              },
              "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."
                }
              ]
            }
          ],
          "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-js\">const buffer = require('buffer');\n\nconst newBuf = buffer.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>\n<p>This is a property on the <code>buffer</code> module returned by\n<code>require('buffer')</code>, not on the <code>Buffer</code> global or a <code>Buffer</code> instance.</p>"
        }
      ],
      "type": "module",
      "displayName": "Buffer"
    },
    {
      "textRaw": "Child process",
      "name": "child_process",
      "introduced_in": "v0.10.0",
      "stability": 2,
      "stabilityText": "Stable",
      "desc": "<p>The <code>child_process</code> module provides the ability to spawn child processes 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_process.html#child_process_child_process_spawn_command_args_options\"><code>child_process.spawn()</code></a> function:</p>\n<pre><code class=\"language-js\">const { spawn } = require('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<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 child. These pipes have\nlimited (and platform-specific) capacity. If the child process writes to\nstdout in excess of that limit without the output being captured, the child\nprocess will block 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 will be performed using <code>options.env.PATH</code> environment\nvariable if passed in <code>options</code> object, otherwise <code>process.env.PATH</code> will be\nused. To account for the fact that Windows environment variables are\ncase-insensitive Node.js will lexicographically sort all <code>env</code> keys and choose\nthe first one case-insensitively matching <code>PATH</code> to perform command lookup.\nThis may lead to issues on Windows when passing objects to <code>env</code> option that\nhave multiple variants of <code>PATH</code> variable.</p>\n<p>The <a href=\"child_process.html#child_process_child_process_spawn_command_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_process.html#child_process_child_process_spawnsync_command_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>child_process</code> module provides a handful of synchronous\nand asynchronous alternatives to <a href=\"child_process.html#child_process_child_process_spawn_command_args_options\"><code>child_process.spawn()</code></a> and\n<a href=\"child_process.html#child_process_child_process_spawnsync_command_args_options\"><code>child_process.spawnSync()</code></a>. Each of these alternatives are implemented on\ntop of <a href=\"child_process.html#child_process_child_process_spawn_command_args_options\"><code>child_process.spawn()</code></a> or <a href=\"child_process.html#child_process_child_process_spawnsync_command_args_options\"><code>child_process.spawnSync()</code></a>.</p>\n<ul>\n<li><a href=\"child_process.html#child_process_child_process_exec_command_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_process.html#child_process_child_process_execfile_file_args_options_callback\"><code>child_process.execFile()</code></a>: similar to <a href=\"child_process.html#child_process_child_process_exec_command_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_process.html#child_process_child_process_fork_modulepath_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_process.html#child_process_child_process_execsync_command_options\"><code>child_process.execSync()</code></a>: a synchronous version of\n<a href=\"child_process.html#child_process_child_process_exec_command_options_callback\"><code>child_process.exec()</code></a> that will block the Node.js event loop.</li>\n<li><a href=\"child_process.html#child_process_child_process_execfilesync_file_args_options\"><code>child_process.execFileSync()</code></a>: a synchronous version of\n<a href=\"child_process.html#child_process_child_process_execfile_file_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=\"child_process.html#child_process_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",
          "desc": "<p>The <a href=\"child_process.html#child_process_child_process_spawn_command_args_options\"><code>child_process.spawn()</code></a>, <a href=\"child_process.html#child_process_child_process_fork_modulepath_args_options\"><code>child_process.fork()</code></a>, <a href=\"child_process.html#child_process_child_process_exec_command_options_callback\"><code>child_process.exec()</code></a>,\nand <a href=\"child_process.html#child_process_child_process_execfile_file_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=\"child_process.html#child_process_child_process\"><code>ChildProcess</code></a> instance. These objects\nimplement the Node.js <a href=\"events.html#events_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_process.html#child_process_child_process_exec_command_options_callback\"><code>child_process.exec()</code></a> and <a href=\"child_process.html#child_process_child_process_execfile_file_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",
              "desc": "<p>The importance of the distinction between <a href=\"child_process.html#child_process_child_process_exec_command_options_callback\"><code>child_process.exec()</code></a> and\n<a href=\"child_process.html#child_process_child_process_execfile_file_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_process.html#child_process_child_process_execfile_file_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_process.html#child_process_child_process_execfile_file_args_options_callback\"><code>child_process.execFile()</code></a>.\nWhen running on Windows, <code>.bat</code> and <code>.cmd</code> files can be invoked using\n<a href=\"child_process.html#child_process_child_process_spawn_command_args_options\"><code>child_process.spawn()</code></a> with the <code>shell</code> option set, with\n<a href=\"child_process.html#child_process_child_process_exec_command_options_callback\"><code>child_process.exec()</code></a>, or by spawning <code>cmd.exe</code> and passing the <code>.bat</code> or\n<code>.cmd</code> file as an argument (which is what the <code>shell</code> option and\n<a href=\"child_process.html#child_process_child_process_exec_command_options_callback\"><code>child_process.exec()</code></a> do). In any case, if the script filename contains\nspaces it needs to be quoted.</p>\n<pre><code class=\"language-js\">// On Windows Only...\nconst { spawn } = require('child_process');\nconst bat = spawn('cmd.exe', ['/c', 'my.bat']);\n\nbat.stdout.on('data', (data) => {\n  console.log(data.toString());\n});\n\nbat.stderr.on('data', (data) => {\n  console.error(data.toString());\n});\n\nbat.on('exit', (code) => {\n  console.log(`Child exited with code ${code}`);\n});\n</code></pre>\n<pre><code class=\"language-js\">// OR...\nconst { exec, spawn } = require('child_process');\nexec('my.bat', (err, stdout, stderr) => {\n  if (err) {\n    console.error(err);\n    return;\n  }\n  console.log(stdout);\n});\n\n// Script with spaces in the filename:\nconst bat = spawn('\"my script.cmd\"', ['a', 'b'], { shell: true });\n// or:\nexec('\"my script.cmd\" a b', (err, stdout, stderr) => {\n  // ...\n});\n</code></pre>",
              "type": "module",
              "displayName": "Spawning `.bat` and `.cmd` files on Windows"
            }
          ],
          "methods": [
            {
              "textRaw": "`child_process.exec(command[, options][, callback])`",
              "type": "method",
              "name": "exec",
              "meta": {
                "added": [
                  "v0.1.90"
                ],
                "changes": [
                  {
                    "version": "v8.8.0",
                    "pr-url": "https://github.com/nodejs/node/pull/15380",
                    "description": "The `windowsHide` option is supported now."
                  }
                ]
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {ChildProcess}",
                    "name": "return",
                    "type": "ChildProcess"
                  },
                  "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} Current working directory of the child process. **Default:** `null`.",
                          "name": "cwd",
                          "type": "string",
                          "default": "`null`",
                          "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": "`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": "`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"
                        }
                      ]
                    }
                  ]
                }
              ],
              "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-js\">exec('\"/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#errors_class_error\"><code>Error</code></a>. The <code>error.code</code> property will be\nthe exit code of the child process while <code>error.signal</code> will be set to the\nsignal that terminated the process. Any exit code other than <code>0</code> is considered\nto be an error.</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-js\">const { exec } = require('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 will send the signal\nidentified by the <code>killSignal</code> property (the default is <code>'SIGTERM'</code>) if the\nchild 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#util_util_promisify_original\"><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-js\">const util = require('util');\nconst exec = util.promisify(require('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>"
            },
            {
              "textRaw": "`child_process.execFile(file[, args][, options][, callback])`",
              "type": "method",
              "name": "execFile",
              "meta": {
                "added": [
                  "v0.1.91"
                ],
                "changes": [
                  {
                    "version": "v8.8.0",
                    "pr-url": "https://github.com/nodejs/node/pull/15380",
                    "description": "The `windowsHide` option is supported now."
                  }
                ]
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {ChildProcess}",
                    "name": "return",
                    "type": "ChildProcess"
                  },
                  "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."
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`cwd` {string} Current working directory of the child process.",
                          "name": "cwd",
                          "type": "string",
                          "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": "`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"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>The <code>child_process.execFile()</code> function is similar to <a href=\"child_process.html#child_process_child_process_exec_command_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_process.html#child_process_child_process_exec_command_options_callback\"><code>child_process.exec()</code></a>.</p>\n<p>The same options as <a href=\"child_process.html#child_process_child_process_exec_command_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-js\">const { execFile } = require('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#util_util_promisify_original\"><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-js\">const util = require('util');\nconst execFile = util.promisify(require('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>"
            },
            {
              "textRaw": "`child_process.fork(modulePath[, args][, options])`",
              "type": "method",
              "name": "fork",
              "meta": {
                "added": [
                  "v0.5.0"
                ],
                "changes": [
                  {
                    "version": "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": [
                {
                  "return": {
                    "textRaw": "Returns: {ChildProcess}",
                    "name": "return",
                    "type": "ChildProcess"
                  },
                  "params": [
                    {
                      "textRaw": "`modulePath` {string} The module to run in the child.",
                      "name": "modulePath",
                      "type": "string",
                      "desc": "The module to run in the child."
                    },
                    {
                      "textRaw": "`args` {string[]} List of string arguments.",
                      "name": "args",
                      "type": "string[]",
                      "desc": "List of string arguments."
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`cwd` {string} Current working directory of the child process.",
                          "name": "cwd",
                          "type": "string",
                          "desc": "Current working directory of the child process."
                        },
                        {
                          "textRaw": "`detached` {boolean} Prepare child to run independently of its parent process. Specific behavior depends on the platform, see [`options.detached`][]).",
                          "name": "detached",
                          "type": "boolean",
                          "desc": "Prepare child 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": "`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": "`silent` {boolean} If `true`, stdin, stdout, and stderr of the child will be piped to the parent, otherwise they will be inherited from the parent, 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 will be piped to the parent, otherwise they will be inherited from the parent, 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": "`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": "`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))."
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>The <code>child_process.fork()</code> method is a special case of\n<a href=\"child_process.html#child_process_child_process_spawn_command_args_options\"><code>child_process.spawn()</code></a> used specifically to spawn new Node.js processes.\nLike <a href=\"child_process.html#child_process_child_process_spawn_command_args_options\"><code>child_process.spawn()</code></a>, a <a href=\"child_process.html#child_process_child_process\"><code>ChildProcess</code></a> object is returned. The\nreturned <a href=\"child_process.html#child_process_child_process\"><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=\"child_process.html#child_process_subprocess_send_message_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#process_process_execpath\"><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_process.html#child_process_child_process_spawn_command_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>"
            },
            {
              "textRaw": "`child_process.spawn(command[, args][, options])`",
              "type": "method",
              "name": "spawn",
              "meta": {
                "added": [
                  "v0.1.90"
                ],
                "changes": [
                  {
                    "version": "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": [
                {
                  "return": {
                    "textRaw": "Returns: {ChildProcess}",
                    "name": "return",
                    "type": "ChildProcess"
                  },
                  "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."
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`cwd` {string} Current working directory of the child process.",
                          "name": "cwd",
                          "type": "string",
                          "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`][`stdio`]).",
                          "name": "stdio",
                          "type": "Array|string",
                          "desc": "Child's stdio configuration (see [`options.stdio`][`stdio`])."
                        },
                        {
                          "textRaw": "`detached` {boolean} Prepare child to run independently of its parent process. Specific behavior depends on the platform, see [`options.detached`][]).",
                          "name": "detached",
                          "type": "boolean",
                          "desc": "Prepare child 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."
                        }
                      ]
                    }
                  ]
                }
              ],
              "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.</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#process_process_env\"><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-js\">const { spawn } = require('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<p>Example: A very elaborate way to run <code>ps ax | grep ssh</code></p>\n<pre><code class=\"language-js\">const { spawn } = require('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-js\">const { spawn } = require('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 currently 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>",
              "properties": [
                {
                  "textRaw": "`options.detached`",
                  "name": "detached",
                  "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 will have\nits own console window. Once enabled for a child process, it cannot be\ndisabled.</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 to exit. To prevent the\nparent 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 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.</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's <code>stdio</code> is inherited, the child will remain attached to the\ncontrolling 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-js\">const { spawn } = require('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<p>Alternatively one can redirect the child process' output into files:</p>\n<pre><code class=\"language-js\">const fs = require('fs');\nconst { spawn } = require('child_process');\nconst out = fs.openSync('./out.log', 'a');\nconst err = fs.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",
                  "meta": {
                    "added": [
                      "v0.7.10"
                    ],
                    "changes": [
                      {
                        "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=\"child_process.html#child_process_subprocess_stdin\"><code>subprocess.stdin</code></a>,\n<a href=\"child_process.html#child_process_subprocess_stdout\"><code>subprocess.stdout</code></a>, and <a href=\"child_process.html#child_process_subprocess_stderr\"><code>subprocess.stderr</code></a> streams on the\n<a href=\"child_process.html#child_process_child_process\"><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>'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=\"child_process.html#child_process_subprocess_stdio\"><code>subprocess.stdio[fd]</code></a>. Pipes\ncreated for fds 0, 1, and 2 are also available as <a href=\"child_process.html#child_process_subprocess_stdin\"><code>subprocess.stdin</code></a>,\n<a href=\"child_process.html#child_process_subprocess_stdout\"><code>subprocess.stdout</code></a> and <a href=\"child_process.html#child_process_subprocess_stderr\"><code>subprocess.stderr</code></a>, respectively.</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=\"child_process.html#child_process_child_process\"><code>ChildProcess</code></a> may have at most one IPC\nstdio file descriptor. Setting this option enables the\n<a href=\"child_process.html#child_process_subprocess_send_message_sendhandle_options_callback\"><code>subprocess.send()</code></a> method. If the child is a Node.js process, the\npresence of an IPC channel will enable <a href=\"process.html#process_process_send_message_sendhandle_options_callback\"><code>process.send()</code></a> and\n<a href=\"process.html#process_process_disconnect\"><code>process.disconnect()</code></a> methods, as well as <a href=\"process.html#process_event_disconnect\"><code>'disconnect'</code></a> and\n<a href=\"process.html#process_event_message\"><code>'message'</code></a> events within the child.</p>\n<p>Accessing the IPC channel fd in any way other than <a href=\"process.html#process_process_send_message_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_stream\" class=\"type\">&lt;Stream&gt;</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 until the <code>'open'</code> event has\noccurred).</p>\n</li>\n<li>\n<p>Positive integer: The integer value is interpreted as a file descriptor\nthat is currently open in the parent process. It is shared with the child\nprocess, similar to how <a href=\"stream.html#stream_stream\" class=\"type\">&lt;Stream&gt;</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-js\">const { spawn } = require('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<p><em>It is worth noting that when an IPC channel is established between the\nparent and child processes, and the child is a Node.js process, the child\nis launched with the IPC channel unreferenced (using <code>unref()</code>) until the\nchild registers an event handler for the <a href=\"process.html#process_event_disconnect\"><code>'disconnect'</code></a> event\nor the <a href=\"process.html#process_event_message\"><code>'message'</code></a> event. This allows the child to exit\nnormally without the process being held open by the open IPC channel.</em></p>\n<p>On Unix-like operating systems, the <a href=\"child_process.html#child_process_child_process_spawn_command_args_options\"><code>child_process.spawn()</code></a> method\nperforms memory operations synchronously before decoupling the event loop\nfrom the child. Applications with a large memory footprint may find frequent\n<a href=\"child_process.html#child_process_child_process_spawn_command_args_options\"><code>child_process.spawn()</code></a> calls to be a bottleneck. For more information,\nsee <a href=\"https://bugs.chromium.org/p/v8/issues/detail?id=7381\">V8 issue 7381</a>.</p>\n<p>See also: <a href=\"child_process.html#child_process_child_process_exec_command_options_callback\"><code>child_process.exec()</code></a> and <a href=\"child_process.html#child_process_child_process_fork_modulepath_args_options\"><code>child_process.fork()</code></a>.</p>"
                }
              ]
            }
          ],
          "type": "module",
          "displayName": "Asynchronous process creation"
        },
        {
          "textRaw": "Synchronous process creation",
          "name": "synchronous_process_creation",
          "desc": "<p>The <a href=\"child_process.html#child_process_child_process_spawnsync_command_args_options\"><code>child_process.spawnSync()</code></a>, <a href=\"child_process.html#child_process_child_process_execsync_command_options\"><code>child_process.execSync()</code></a>, and\n<a href=\"child_process.html#child_process_child_process_execfilesync_file_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])`",
              "type": "method",
              "name": "execFileSync",
              "meta": {
                "added": [
                  "v0.11.12"
                ],
                "changes": [
                  {
                    "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": [
                {
                  "return": {
                    "textRaw": "Returns: {Buffer|string} The stdout from the command.",
                    "name": "return",
                    "type": "Buffer|string",
                    "desc": "The stdout from the command."
                  },
                  "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."
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`cwd` {string} Current working directory of the child process.",
                          "name": "cwd",
                          "type": "string",
                          "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. 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. Supplying this value will override `stdio[0]`."
                        },
                        {
                          "textRaw": "`stdio` {string|Array} Child's stdio configuration. `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. `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][]."
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>The <code>child_process.execFileSync()</code> method is generally identical to\n<a href=\"child_process.html#child_process_child_process_execfile_file_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#errors_class_error\"><code>Error</code></a> that will include the full result of the underlying\n<a href=\"child_process.html#child_process_child_process_spawnsync_command_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>"
            },
            {
              "textRaw": "`child_process.execSync(command[, options])`",
              "type": "method",
              "name": "execSync",
              "meta": {
                "added": [
                  "v0.11.12"
                ],
                "changes": [
                  {
                    "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": [
                {
                  "return": {
                    "textRaw": "Returns: {Buffer|string} The stdout from the command.",
                    "name": "return",
                    "type": "Buffer|string",
                    "desc": "The stdout from the command."
                  },
                  "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} Current working directory of the child process.",
                          "name": "cwd",
                          "type": "string",
                          "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. 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. Supplying this value will override `stdio[0]`."
                        },
                        {
                          "textRaw": "`stdio` {string|Array} Child's stdio configuration. `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. `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."
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>The <code>child_process.execSync()</code> method is generally identical to\n<a href=\"child_process.html#child_process_child_process_exec_command_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#errors_class_error\"><code>Error</code></a> object will contain the entire result from\n<a href=\"child_process.html#child_process_child_process_spawnsync_command_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])`",
              "type": "method",
              "name": "spawnSync",
              "meta": {
                "added": [
                  "v0.11.12"
                ],
                "changes": [
                  {
                    "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": [
                {
                  "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."
                      }
                    ]
                  },
                  "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."
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`cwd` {string} Current working directory of the child process.",
                          "name": "cwd",
                          "type": "string",
                          "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. 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. 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.",
                          "name": "stdio",
                          "type": "string|Array",
                          "desc": "Child's stdio configuration."
                        },
                        {
                          "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."
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>The <code>child_process.spawnSync()</code> method is generally identical to\n<a href=\"child_process.html#child_process_child_process_spawn_command_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>"
            }
          ],
          "type": "module",
          "displayName": "Synchronous process creation"
        },
        {
          "textRaw": "`maxBuffer` and Unicode",
          "name": "`maxbuffer`_and_unicode",
          "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>",
          "type": "module",
          "displayName": "`maxBuffer` and Unicode"
        },
        {
          "textRaw": "Shell requirements",
          "name": "shell_requirements",
          "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>",
          "type": "module",
          "displayName": "Shell requirements"
        },
        {
          "textRaw": "Default Windows shell",
          "name": "default_windows_shell",
          "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>",
          "type": "module",
          "displayName": "Default Windows shell"
        },
        {
          "textRaw": "Advanced serialization",
          "name": "advanced_serialization",
          "meta": {
            "added": [
              "v12.16.0"
            ],
            "changes": []
          },
          "desc": "<p>Child processes support a serialization mechanism for IPC that is based on the\n<a href=\"v8.html#v8_serialization_api\">serialization API of the <code>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_process.html#child_process_child_process_spawn_command_args_options\"><code>child_process.spawn()</code></a>\nor <a href=\"child_process.html#child_process_child_process_fork_modulepath_args_options\"><code>child_process.fork()</code></a>.</p>",
          "type": "module",
          "displayName": "Advanced serialization"
        }
      ],
      "classes": [
        {
          "textRaw": "Class: `ChildProcess`",
          "type": "class",
          "name": "ChildProcess",
          "meta": {
            "added": [
              "v2.2.0"
            ],
            "changes": []
          },
          "desc": "<ul>\n<li>Extends: <a href=\"events.html#events_class_eventemitter\" class=\"type\">&lt;EventEmitter&gt;</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_process.html#child_process_child_process_spawn_command_args_options\"><code>child_process.spawn()</code></a>, <a href=\"child_process.html#child_process_child_process_exec_command_options_callback\"><code>child_process.exec()</code></a>,\n<a href=\"child_process.html#child_process_child_process_execfile_file_args_options_callback\"><code>child_process.execFile()</code></a>, or <a href=\"child_process.html#child_process_child_process_fork_modulepath_args_options\"><code>child_process.fork()</code></a> methods to create\ninstances of <code>ChildProcess</code>.</p>",
          "events": [
            {
              "textRaw": "Event: `'close'`",
              "type": "event",
              "name": "close",
              "meta": {
                "added": [
                  "v0.7.7"
                ],
                "changes": []
              },
              "params": [
                {
                  "textRaw": "`code` {number} The exit code if the child exited on its own.",
                  "name": "code",
                  "type": "number",
                  "desc": "The exit code if the child exited on its own."
                },
                {
                  "textRaw": "`signal` {string} The signal by which the child process was terminated.",
                  "name": "signal",
                  "type": "string",
                  "desc": "The signal by which the child process was terminated."
                }
              ],
              "desc": "<p>The <code>'close'</code> event is emitted when the stdio streams of a child process have\nbeen closed. This is distinct from the <a href=\"child_process.html#child_process_event_exit\"><code>'exit'</code></a> event, since multiple\nprocesses might share the same stdio streams.</p>\n<pre><code class=\"language-js\">const { spawn } = require('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>"
            },
            {
              "textRaw": "Event: `'disconnect'`",
              "type": "event",
              "name": "disconnect",
              "meta": {
                "added": [
                  "v0.7.2"
                ],
                "changes": []
              },
              "params": [],
              "desc": "<p>The <code>'disconnect'</code> event is emitted after calling the\n<a href=\"child_process.html#child_process_subprocess_disconnect\"><code>subprocess.disconnect()</code></a> method in parent process or\n<a href=\"process.html#process_process_disconnect\"><code>process.disconnect()</code></a> in child process. After disconnecting it is no longer\npossible to send or receive messages, and the <a href=\"child_process.html#child_process_subprocess_connected\"><code>subprocess.connected</code></a>\nproperty is <code>false</code>.</p>"
            },
            {
              "textRaw": "Event: `'error'`",
              "type": "event",
              "name": "error",
              "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<ol>\n<li>The process could not be spawned, or</li>\n<li>The process could not be killed, or</li>\n<li>Sending a message to the child process failed.</li>\n</ol>\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=\"child_process.html#child_process_subprocess_kill_signal\"><code>subprocess.kill()</code></a> and <a href=\"child_process.html#child_process_subprocess_send_message_sendhandle_options_callback\"><code>subprocess.send()</code></a>.</p>"
            },
            {
              "textRaw": "Event: `'exit'`",
              "type": "event",
              "name": "exit",
              "meta": {
                "added": [
                  "v0.1.90"
                ],
                "changes": []
              },
              "params": [
                {
                  "textRaw": "`code` {number} The exit code if the child exited on its own.",
                  "name": "code",
                  "type": "number",
                  "desc": "The exit code if the child exited on its own."
                },
                {
                  "textRaw": "`signal` {string} The signal by which the child process was terminated.",
                  "name": "signal",
                  "type": "string",
                  "desc": "The signal by which the child process was terminated."
                }
              ],
              "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>"
            },
            {
              "textRaw": "Event: `'message'`",
              "type": "event",
              "name": "message",
              "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} A [`net.Socket`][] or [`net.Server`][] object, or undefined.",
                  "name": "sendHandle",
                  "type": "Handle",
                  "desc": "A [`net.Socket`][] or [`net.Server`][] object, or undefined."
                }
              ],
              "desc": "<p>The <code>'message'</code> event is triggered when a child process uses\n<a href=\"process.html#process_process_send_message_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=\"child_process.html#child_process_advanced_serialization\">Advanced serialization</a> for more details.</p>"
            }
          ],
          "properties": [
            {
              "textRaw": "`channel` {Object} A pipe representing the IPC channel to the child process.",
              "type": "Object",
              "name": "channel",
              "meta": {
                "added": [
                  "v7.1.0"
                ],
                "changes": []
              },
              "desc": "<p>The <code>subprocess.channel</code> property is a reference to the child's IPC channel. If\nno IPC channel currently exists, this property is <code>undefined</code>.</p>",
              "shortDesc": "A pipe representing the IPC channel to the child process."
            },
            {
              "textRaw": "`connected` {boolean} Set to `false` after `subprocess.disconnect()` is called.",
              "type": "boolean",
              "name": "connected",
              "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": "`exitCode` {integer}",
              "type": "integer",
              "name": "exitCode",
              "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>"
            },
            {
              "textRaw": "`killed` {boolean} Set to `true` after `subprocess.kill()` is used to successfully send a signal to the child process.",
              "type": "boolean",
              "name": "killed",
              "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": "`pid` {integer}",
              "type": "integer",
              "name": "pid",
              "meta": {
                "added": [
                  "v0.1.90"
                ],
                "changes": []
              },
              "desc": "<p>Returns the process identifier (PID) of the child process.</p>\n<pre><code class=\"language-js\">const { spawn } = require('child_process');\nconst grep = spawn('grep', ['ssh']);\n\nconsole.log(`Spawned child pid: ${grep.pid}`);\ngrep.stdin.end();\n</code></pre>"
            },
            {
              "textRaw": "`signalCode` {integer}",
              "type": "integer",
              "name": "signalCode",
              "desc": "<p>The <code>subprocess.signalCode</code> property indicates the signal number received by\nthe child process if any, else <code>null</code>.</p>"
            },
            {
              "textRaw": "`spawnargs` {Array}",
              "type": "Array",
              "name": "spawnargs",
              "desc": "<p>The <code>subprocess.spawnargs</code> property represents the full list of command line\narguments the child process was launched with.</p>"
            },
            {
              "textRaw": "`spawnfile` {string}",
              "type": "string",
              "name": "spawnfile",
              "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_process.html#child_process_child_process_fork_modulepath_args_options\"><code>child_process.fork()</code></a>, its value will be equal to\n<a href=\"process.html#process_process_execpath\"><code>process.execPath</code></a>.\nFor <a href=\"child_process.html#child_process_child_process_spawn_command_args_options\"><code>child_process.spawn()</code></a>, its value will be the name of\nthe executable file.\nFor <a href=\"child_process.html#child_process_child_process_exec_command_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": "`stderr` {stream.Readable}",
              "type": "stream.Readable",
              "name": "stderr",
              "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 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>"
            },
            {
              "textRaw": "`stdin` {stream.Writable}",
              "type": "stream.Writable",
              "name": "stdin",
              "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 will not continue\nuntil this stream has been closed via <code>end()</code>.</p>\n<p>If the child 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>"
            },
            {
              "textRaw": "`stdio` {Array}",
              "type": "Array",
              "name": "stdio",
              "meta": {
                "added": [
                  "v0.7.10"
                ],
                "changes": []
              },
              "desc": "<p>A sparse array of pipes to the child process, corresponding with positions in\nthe <a href=\"child_process.html#child_process_options_stdio\"><code>stdio</code></a> option passed to <a href=\"child_process.html#child_process_child_process_spawn_command_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-js\">const assert = require('assert');\nconst fs = require('fs');\nconst child_process = require('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>"
            },
            {
              "textRaw": "`stdout` {stream.Readable}",
              "type": "stream.Readable",
              "name": "stdout",
              "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 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-js\">const { spawn } = require('child_process');\n\nconst subprocess = spawn('ls');\n\nsubprocess.stdout.on('data', (data) => {\n  console.log(`Received chunk ${data}`);\n});\n</code></pre>"
            }
          ],
          "methods": [
            {
              "textRaw": "`subprocess.disconnect()`",
              "type": "method",
              "name": "disconnect",
              "meta": {
                "added": [
                  "v0.7.2"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Closes the IPC channel between parent and child, allowing the child to exit\ngracefully once there are no other connections keeping it alive. After calling\nthis method the <code>subprocess.connected</code> and <code>process.connected</code> properties in\nboth the parent and child (respectively) will be set to <code>false</code>, and it will be\nno longer possible to 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_process.html#child_process_child_process_fork_modulepath_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])`",
              "type": "method",
              "name": "kill",
              "meta": {
                "added": [
                  "v0.1.90"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  },
                  "params": [
                    {
                      "textRaw": "`signal` {number|string}",
                      "name": "signal",
                      "type": "number|string"
                    }
                  ]
                }
              ],
              "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-js\">const { spawn } = require('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=\"child_process.html#child_process_child_process\"><code>ChildProcess</code></a> object may emit an <a href=\"child_process.html#child_process_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 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-js\">'use strict';\nconst { spawn } = require('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.ref()`",
              "type": "method",
              "name": "ref",
              "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\nto wait for the child to exit before exiting itself.</p>\n<pre><code class=\"language-js\">const { spawn } = require('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>"
            },
            {
              "textRaw": "`subprocess.send(message[, sendHandle[, options]][, callback])`",
              "type": "method",
              "name": "send",
              "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": [
                {
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  },
                  "params": [
                    {
                      "textRaw": "`message` {Object}",
                      "name": "message",
                      "type": "Object"
                    },
                    {
                      "textRaw": "`sendHandle` {Handle}",
                      "name": "sendHandle",
                      "type": "Handle"
                    },
                    {
                      "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."
                        }
                      ]
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function"
                    }
                  ]
                }
              ],
              "desc": "<p>When an IPC channel has been established between the parent and child (\ni.e. when using <a href=\"child_process.html#child_process_child_process_fork_modulepath_args_options\"><code>child_process.fork()</code></a>), the <code>subprocess.send()</code> method can\nbe 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#process_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-js\">const cp = require('child_process');\nconst n = cp.fork(`${__dirname}/sub.js`);\n\nn.on('message', (m) => {\n  console.log('PARENT got message:', m);\n});\n\n// Causes the child to print: CHILD got message: { hello: 'world' }\nn.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', (m) => {\n  console.log('CHILD got message:', m);\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#process_process_send_message_sendhandle_options_callback\"><code>process.send()</code></a> method of their own\nthat allows the child to send messages back to the parent.</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#process_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 will\nreceive the object as the second argument passed to the callback function\nregistered on the <a href=\"process.html#process_event_message\"><code>'message'</code></a> event. Any data that is received\nand buffered in the socket will not be sent to the child.</p>\n<p>The optional <code>callback</code> is a function that is invoked after the message is\nsent but before the child may have received it. The function is called with a\nsingle argument: <code>null</code> on success, or an <a href=\"errors.html#errors_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=\"child_process.html#child_process_child_process\"><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>\n<h4>Example: sending a server object</h4>\n<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-js\">const subprocess = require('child_process').fork('subprocess.js');\n\n// Open up the server object and send the handle.\nconst server = require('net').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 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>net</code> module, <code>dgram</code>\nmodule servers use exactly the same workflow with the exceptions of listening on\na <code>'message'</code> event instead of <code>'connection'</code> and using <code>server.bind()</code> instead\nof <code>server.listen()</code>. This is, however, currently only supported on Unix\nplatforms.</p>\n<h4>Example: sending a socket object</h4>\n<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-js\">const { fork } = require('child_process');\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 = require('net').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>Once a socket has been passed to a child, the parent is no longer capable of\ntracking when the socket is destroyed. To indicate this, the <code>.connections</code>\nproperty becomes <code>null</code>. It is recommended not to use <code>.maxConnections</code> when\nthis occurs.</p>\n<p>It is also recommended that any <code>'message'</code> handlers in the child process\nverify that <code>socket</code> exists, as the connection may have been closed during the\ntime it takes to send the connection to the child.</p>"
            },
            {
              "textRaw": "`subprocess.unref()`",
              "type": "method",
              "name": "unref",
              "meta": {
                "added": [
                  "v0.7.10"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>By default, the parent will wait for the detached child to exit. To prevent the\nparent 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 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.</p>\n<pre><code class=\"language-js\">const { spawn } = require('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>"
            }
          ]
        }
      ],
      "type": "module",
      "displayName": "Child process"
    },
    {
      "textRaw": "Cluster",
      "name": "cluster",
      "introduced_in": "v0.10.0",
      "stability": 2,
      "stabilityText": "Stable",
      "desc": "<p>A single instance of Node.js runs in a single thread. To take advantage of\nmulti-core systems, the user will sometimes want to launch a cluster of Node.js\nprocesses to handle the load.</p>\n<p>The cluster module allows easy creation of child processes that all share\nserver ports.</p>\n<pre><code class=\"language-js\">const cluster = require('cluster');\nconst http = require('http');\nconst numCPUs = require('os').cpus().length;\n\nif (cluster.isMaster) {\n  console.log(`Master ${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\nMaster 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_process_child_process_fork_modulepath_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 master 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 master 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 master\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 master,\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 master\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>cluster</code> module is networking, it can\nalso be used for other use cases requiring worker processes.</p>"
        }
      ],
      "classes": [
        {
          "textRaw": "Class: `Worker`",
          "type": "class",
          "name": "Worker",
          "meta": {
            "added": [
              "v0.7.0"
            ],
            "changes": []
          },
          "desc": "<ul>\n<li>Extends: <a href=\"events.html#events_class_eventemitter\" class=\"type\">&lt;EventEmitter&gt;</a></li>\n</ul>\n<p>A <code>Worker</code> object contains all public information and method about a worker.\nIn the master 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'`",
              "type": "event",
              "name": "disconnect",
              "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'`",
              "type": "event",
              "name": "error",
              "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_process_child_process_fork_modulepath_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'`",
              "type": "event",
              "name": "exit",
              "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-js\">const worker = cluster.fork();\nworker.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</code></pre>"
            },
            {
              "textRaw": "Event: `'listening'`",
              "type": "event",
              "name": "listening",
              "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-js\">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'`",
              "type": "event",
              "name": "message",
              "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#process_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 master\nprocess of the number of HTTP requests received by the workers:</p>\n<pre><code class=\"language-js\">const cluster = require('cluster');\nconst http = require('http');\n\nif (cluster.isMaster) {\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 = require('os').cpus().length;\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 master about the request\n    process.send({ cmd: 'notifyRequest' });\n  }).listen(8000);\n}\n</code></pre>"
            },
            {
              "textRaw": "Event: `'online'`",
              "type": "event",
              "name": "online",
              "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()`",
              "type": "method",
              "name": "disconnect",
              "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": [
                {
                  "return": {
                    "textRaw": "Returns: {cluster.Worker} A reference to `worker`.",
                    "name": "return",
                    "type": "cluster.Worker",
                    "desc": "A reference to `worker`."
                  },
                  "params": []
                }
              ],
              "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 master, 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#net_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#child_process_subprocess_disconnect\"><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.isMaster) {\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('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()`",
              "type": "method",
              "name": "isConnected",
              "meta": {
                "added": [
                  "v0.11.14"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>This function returns <code>true</code> if the worker is connected to its master via its\nIPC channel, <code>false</code> otherwise. A worker is connected to its master after it\nhas been created. It is disconnected after the <code>'disconnect'</code> event is emitted.</p>"
            },
            {
              "textRaw": "`worker.isDead()`",
              "type": "method",
              "name": "isDead",
              "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-js\">const cluster = require('cluster');\nconst http = require('http');\nconst numCPUs = require('os').cpus().length;\n\nif (cluster.isMaster) {\n  console.log(`Master ${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])`",
              "type": "method",
              "name": "kill",
              "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",
                      "desc": "Name of the kill signal to send to the worker process. **Default**: `'SIGTERM'`"
                    }
                  ]
                }
              ],
              "desc": "<p>This function will kill the worker. In the master, it does this by disconnecting\nthe <code>worker.process</code>, and once disconnected, killing with <code>signal</code>. In the\nworker, it does it by disconnecting the channel, and then exiting with code <code>0</code>.</p>\n<p>Because <code>kill()</code> attempts to gracefully disconnect the worker process, it is\nsusceptible to waiting indefinitely for the disconnect to complete. For example,\nif the worker enters an infinite loop, a graceful disconnect will never occur.\nIf the graceful disconnect behavior is not needed, use <code>worker.process.kill()</code>.</p>\n<p>Causes <code>.exitedAfterDisconnect</code> to be set.</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#process_process_kill_pid_signal\"><code>kill()</code></a>.</p>"
            },
            {
              "textRaw": "`worker.send(message[, sendHandle[, options]][, callback])`",
              "type": "method",
              "name": "send",
              "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": [
                {
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  },
                  "params": [
                    {
                      "textRaw": "`message` {Object}",
                      "name": "message",
                      "type": "Object"
                    },
                    {
                      "textRaw": "`sendHandle` {Handle}",
                      "name": "sendHandle",
                      "type": "Handle"
                    },
                    {
                      "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."
                        }
                      ]
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function"
                    }
                  ]
                }
              ],
              "desc": "<p>Send a message to a worker or master, optionally with a handle.</p>\n<p>In the master this sends a message to a specific worker. It is identical to\n<a href=\"child_process.html#child_process_subprocess_send_message_sendhandle_options_callback\"><code>ChildProcess.send()</code></a>.</p>\n<p>In a worker this sends a message to the master. It is identical to\n<code>process.send()</code>.</p>\n<p>This example will echo back all messages from the master:</p>\n<pre><code class=\"language-js\">if (cluster.isMaster) {\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": "`exitedAfterDisconnect` {boolean}",
              "type": "boolean",
              "name": "exitedAfterDisconnect",
              "meta": {
                "added": [
                  "v6.0.0"
                ],
                "changes": []
              },
              "desc": "<p>This property is <code>true</code> if the worker exited due to <code>.kill()</code> or\n<code>.disconnect()</code>. If 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=\"cluster.html#cluster_worker_exitedafterdisconnect\"><code>worker.exitedAfterDisconnect</code></a> allows distinguishing between\nvoluntary and accidental exit, the master 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": "`id` {number}",
              "type": "number",
              "name": "id",
              "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": "`process` {ChildProcess}",
              "type": "ChildProcess",
              "name": "process",
              "meta": {
                "added": [
                  "v0.7.0"
                ],
                "changes": []
              },
              "desc": "<p>All workers are created using <a href=\"child_process.html#child_process_child_process_fork_modulepath_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_process_child_process_fork_modulepath_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'`",
          "type": "event",
          "name": "disconnect",
          "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'`",
          "type": "event",
          "name": "exit",
          "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=\"cluster.html#cluster_cluster_fork_env\"><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#child_process_event_exit\"><code>child_process</code> event: <code>'exit'</code></a>.</p>"
        },
        {
          "textRaw": "Event: `'fork'`",
          "type": "event",
          "name": "fork",
          "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'`",
          "type": "event",
          "name": "listening",
          "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\nmaster.</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> (UDP v4 or v6)</li>\n</ul>"
        },
        {
          "textRaw": "Event: `'message'`",
          "type": "event",
          "name": "message",
          "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 master receives a message from any worker.</p>\n<p>See <a href=\"child_process.html#child_process_event_message\"><code>child_process</code> event: <code>'message'</code></a>.</p>"
        },
        {
          "textRaw": "Event: `'online'`",
          "type": "event",
          "name": "online",
          "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 master 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\nmaster 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'`",
          "type": "event",
          "name": "setup",
          "meta": {
            "added": [
              "v0.7.1"
            ],
            "changes": []
          },
          "params": [
            {
              "textRaw": "`settings` {Object}",
              "name": "settings",
              "type": "Object"
            }
          ],
          "desc": "<p>Emitted every time <a href=\"cluster.html#cluster_cluster_setupmaster_settings\"><code>.setupMaster()</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=\"cluster.html#cluster_cluster_setupmaster_settings\"><code>.setupMaster()</code></a> was called and is advisory only, since multiple calls to\n<a href=\"cluster.html#cluster_cluster_setupmaster_settings\"><code>.setupMaster()</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])`",
          "type": "method",
          "name": "disconnect",
          "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."
                }
              ]
            }
          ],
          "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\nmaster 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 master process.</p>"
        },
        {
          "textRaw": "`cluster.fork([env])`",
          "type": "method",
          "name": "fork",
          "meta": {
            "added": [
              "v0.6.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "return": {
                "textRaw": "Returns: {cluster.Worker}",
                "name": "return",
                "type": "cluster.Worker"
              },
              "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."
                }
              ]
            }
          ],
          "desc": "<p>Spawn a new worker process.</p>\n<p>This can only be called from the master process.</p>"
        },
        {
          "textRaw": "`cluster.setupMaster([settings])`",
          "type": "method",
          "name": "setupMaster",
          "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."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`settings` {Object} See [`cluster.settings`][].",
                  "name": "settings",
                  "type": "Object",
                  "desc": "See [`cluster.settings`][]."
                }
              ]
            }
          ],
          "desc": "<p><code>setupMaster</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=\"cluster.html#cluster_cluster_fork_env\"><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>.setupMaster()</code> is\nthe <code>env</code> passed to <a href=\"cluster.html#cluster_cluster_fork_env\"><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.setupMaster()</code> is called.</p>\n<pre><code class=\"language-js\">const cluster = require('cluster');\ncluster.setupMaster({\n  exec: 'worker.js',\n  args: ['--use', 'https'],\n  silent: true\n});\ncluster.fork(); // https worker\ncluster.setupMaster({\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 master process.</p>"
        }
      ],
      "properties": [
        {
          "textRaw": "`isMaster` {boolean}",
          "type": "boolean",
          "name": "isMaster",
          "meta": {
            "added": [
              "v0.8.1"
            ],
            "changes": []
          },
          "desc": "<p>True if the process is a master. This is determined\nby the <code>process.env.NODE_UNIQUE_ID</code>. If <code>process.env.NODE_UNIQUE_ID</code> is\nundefined, then <code>isMaster</code> is <code>true</code>.</p>"
        },
        {
          "textRaw": "`isWorker` {boolean}",
          "type": "boolean",
          "name": "isWorker",
          "meta": {
            "added": [
              "v0.6.0"
            ],
            "changes": []
          },
          "desc": "<p>True if the process is not a master (it is the negation of <code>cluster.isMaster</code>).</p>"
        },
        {
          "textRaw": "`cluster.schedulingPolicy`",
          "name": "schedulingPolicy",
          "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=\"cluster.html#cluster_cluster_setupmaster_settings\"><code>.setupMaster()</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": "`settings` {Object}",
          "type": "Object",
          "name": "settings",
          "meta": {
            "added": [
              "v0.7.1"
            ],
            "changes": [
              {
                "version": "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."
              }
            ]
          },
          "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`.",
              "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`."
            },
            {
              "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 master'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 master'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."
            }
          ],
          "desc": "<p>After calling <a href=\"cluster.html#cluster_cluster_setupmaster_settings\"><code>.setupMaster()</code></a> (or <a href=\"cluster.html#cluster_cluster_fork_env\"><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>"
        },
        {
          "textRaw": "`worker` {Object}",
          "type": "Object",
          "name": "worker",
          "meta": {
            "added": [
              "v0.7.0"
            ],
            "changes": []
          },
          "desc": "<p>A reference to the current worker object. Not available in the master process.</p>\n<pre><code class=\"language-js\">const cluster = require('cluster');\n\nif (cluster.isMaster) {\n  console.log('I am master');\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": "`workers` {Object}",
          "type": "Object",
          "name": "workers",
          "meta": {
            "added": [
              "v0.7.0"
            ],
            "changes": []
          },
          "desc": "<p>A hash that stores the active worker objects, keyed by <code>id</code> field. Makes it\neasy to loop through all the workers. It is only available in the master\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 last <code>'disconnect'</code> or <code>'exit'</code> event is emitted.</p>\n<pre><code class=\"language-js\">// Go through all workers\nfunction eachWorker(callback) {\n  for (const id in cluster.workers) {\n    callback(cluster.workers[id]);\n  }\n}\neachWorker((worker) => {\n  worker.send('big announcement to all workers');\n});\n</code></pre>\n<p>Using the worker's unique id is the easiest way to locate the worker.</p>\n<pre><code class=\"language-js\">socket.on('data', (id) => {\n  const worker = cluster.workers[id];\n});\n</code></pre>"
        }
      ],
      "type": "module",
      "displayName": "Cluster"
    },
    {
      "textRaw": "Console",
      "name": "console",
      "introduced_in": "v0.10.13",
      "stability": 2,
      "stabilityText": "Stable",
      "desc": "<p>The <code>console</code> module provides a simple debugging console that is similar to the\nJavaScript 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#process_process_stdout\"><code>process.stdout</code></a> and\n<a href=\"process.html#process_process_stderr\"><code>process.stderr</code></a>. The global <code>console</code> can be used without calling\n<code>require('console')</code>.</li>\n</ul>\n<p><strong><em>Warning</em></strong>: 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. See the <a href=\"process.html#process_a_note_on_process_i_o\">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: Whoops, something bad happened], to stderr\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`",
          "type": "class",
          "name": "Console",
          "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('console').Console</code>\nor <code>console.Console</code> (or their destructured counterparts):</p>\n<pre><code class=\"language-js\">const { Console } = require('console');\n</code></pre>\n<pre><code class=\"language-js\">const { Console } = console;\n</code></pre>",
          "methods": [
            {
              "textRaw": "`console.assert(value[, ...message])`",
              "type": "method",
              "name": "assert",
              "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."
                    }
                  ]
                }
              ],
              "desc": "<p>A simple assertion test that verifies whether <code>value</code> is truthy. If it is not,\n<code>Assertion failed</code> is logged. If provided, the error <code>message</code> is formatted\nusing <a href=\"util.html#util_util_format_format_args\"><code>util.format()</code></a> by passing along all message arguments. The output is\nused as the error message.</p>\n<pre><code class=\"language-js\">console.assert(true, 'does nothing');\n// OK\nconsole.assert(false, 'Whoops %s work', 'didn\\'t');\n// Assertion failed: Whoops didn't work\n</code></pre>\n<p>Calling <code>console.assert()</code> with a falsy assertion will only cause the <code>message</code>\nto be printed to the console without interrupting execution of subsequent code.</p>"
            },
            {
              "textRaw": "`console.clear()`",
              "type": "method",
              "name": "clear",
              "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])`",
              "type": "method",
              "name": "count",
              "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."
                    }
                  ]
                }
              ],
              "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<!-- eslint-skip -->\n<pre><code class=\"language-js\">> 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])`",
              "type": "method",
              "name": "countReset",
              "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."
                    }
                  ]
                }
              ],
              "desc": "<p>Resets the internal counter specific to <code>label</code>.</p>\n<!-- eslint-skip -->\n<pre><code class=\"language-js\">> 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])`",
              "type": "method",
              "name": "debug",
              "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"
                    }
                  ]
                }
              ],
              "desc": "<p>The <code>console.debug()</code> function is an alias for <a href=\"console.html#console_console_log_data_args\"><code>console.log()</code></a>.</p>"
            },
            {
              "textRaw": "`console.dir(obj[, options])`",
              "type": "method",
              "name": "dir",
              "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][]."
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Uses <a href=\"util.html#util_util_inspect_object_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)`",
              "type": "method",
              "name": "dirxml",
              "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])`",
              "type": "method",
              "name": "error",
              "meta": {
                "added": [
                  "v0.1.100"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`data` {any}",
                      "name": "data",
                      "type": "any"
                    },
                    {
                      "textRaw": "`...args` {any}",
                      "name": "...args",
                      "type": "any"
                    }
                  ]
                }
              ],
              "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\n<a href=\"util.html#util_util_format_format_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#util_util_inspect_object_options\"><code>util.inspect()</code></a> is called on each argument and the resulting string\nvalues are concatenated. See <a href=\"util.html#util_util_format_format_args\"><code>util.format()</code></a> for more information.</p>"
            },
            {
              "textRaw": "`console.group([...label])`",
              "type": "method",
              "name": "group",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`...label` {any}",
                      "name": "...label",
                      "type": "any"
                    }
                  ]
                }
              ],
              "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()`",
              "type": "method",
              "name": "groupCollapsed",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>An alias for <a href=\"console.html#console_console_group_label\"><code>console.group()</code></a>.</p>"
            },
            {
              "textRaw": "`console.groupEnd()`",
              "type": "method",
              "name": "groupEnd",
              "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])`",
              "type": "method",
              "name": "info",
              "meta": {
                "added": [
                  "v0.1.100"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`data` {any}",
                      "name": "data",
                      "type": "any"
                    },
                    {
                      "textRaw": "`...args` {any}",
                      "name": "...args",
                      "type": "any"
                    }
                  ]
                }
              ],
              "desc": "<p>The <code>console.info()</code> function is an alias for <a href=\"console.html#console_console_log_data_args\"><code>console.log()</code></a>.</p>"
            },
            {
              "textRaw": "`console.log([data][, ...args])`",
              "type": "method",
              "name": "log",
              "meta": {
                "added": [
                  "v0.1.100"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`data` {any}",
                      "name": "data",
                      "type": "any"
                    },
                    {
                      "textRaw": "`...args` {any}",
                      "name": "...args",
                      "type": "any"
                    }
                  ]
                }
              ],
              "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\n<a href=\"util.html#util_util_format_format_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#util_util_format_format_args\"><code>util.format()</code></a> for more information.</p>"
            },
            {
              "textRaw": "`console.table(tabularData[, properties])`",
              "type": "method",
              "name": "table",
              "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."
                    }
                  ]
                }
              ],
              "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])`",
              "type": "method",
              "name": "time",
              "meta": {
                "added": [
                  "v0.1.104"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`label` {string} **Default:** `'default'`",
                      "name": "label",
                      "type": "string",
                      "default": "`'default'`"
                    }
                  ]
                }
              ],
              "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=\"console.html#console_console_timeend_label\"><code>console.timeEnd()</code></a> to stop the timer and output the elapsed time in\nmilliseconds to <code>stdout</code>. Timer durations are accurate to the sub-millisecond.</p>"
            },
            {
              "textRaw": "`console.timeEnd([label])`",
              "type": "method",
              "name": "timeEnd",
              "meta": {
                "added": [
                  "v0.1.104"
                ],
                "changes": [
                  {
                    "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'`"
                    }
                  ]
                }
              ],
              "desc": "<p>Stops a timer that was previously started by calling <a href=\"console.html#console_console_time_label\"><code>console.time()</code></a> and\nprints the result to <code>stdout</code>:</p>\n<pre><code class=\"language-js\">console.time('100-elements');\nfor (let i = 0; i &#x3C; 100; i++) {}\nconsole.timeEnd('100-elements');\n// prints 100-elements: 225.438ms\n</code></pre>"
            },
            {
              "textRaw": "`console.timeLog([label][, ...data])`",
              "type": "method",
              "name": "timeLog",
              "meta": {
                "added": [
                  "v10.7.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`label` {string} **Default:** `'default'`",
                      "name": "label",
                      "type": "string",
                      "default": "`'default'`"
                    },
                    {
                      "textRaw": "`...data` {any}",
                      "name": "...data",
                      "type": "any"
                    }
                  ]
                }
              ],
              "desc": "<p>For a timer that was previously started by calling <a href=\"console.html#console_console_time_label\"><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])`",
              "type": "method",
              "name": "trace",
              "meta": {
                "added": [
                  "v0.1.104"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`message` {any}",
                      "name": "message",
                      "type": "any"
                    },
                    {
                      "textRaw": "`...args` {any}",
                      "name": "...args",
                      "type": "any"
                    }
                  ]
                }
              ],
              "desc": "<p>Prints to <code>stderr</code> the string <code>'Trace: '</code>, followed by the <a href=\"util.html#util_util_format_format_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])`",
              "type": "method",
              "name": "warn",
              "meta": {
                "added": [
                  "v0.1.100"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`data` {any}",
                      "name": "data",
                      "type": "any"
                    },
                    {
                      "textRaw": "`...args` {any}",
                      "name": "...args",
                      "type": "any"
                    }
                  ]
                }
              ],
              "desc": "<p>The <code>console.warn()</code> function is an alias for <a href=\"console.html#console_console_error_data_args\"><code>console.error()</code></a>.</p>"
            }
          ],
          "signatures": [
            {
              "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} Specifies options that are passed along to [`util.inspect()`][].",
                      "name": "inspectOptions",
                      "type": "Object",
                      "desc": "Specifies options that are passed along to [`util.inspect()`][]."
                    },
                    {
                      "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-js\">const 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#process_process_stdout\"><code>process.stdout</code></a> and <a href=\"process.html#process_process_stderr\"><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>"
            },
            {
              "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} Specifies options that are passed along to [`util.inspect()`][].",
                      "name": "inspectOptions",
                      "type": "Object",
                      "desc": "Specifies options that are passed along to [`util.inspect()`][]."
                    },
                    {
                      "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-js\">const 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#process_process_stdout\"><code>process.stdout</code></a> and <a href=\"process.html#process_process_stderr\"><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>"
            }
          ]
        }
      ],
      "modules": [
        {
          "textRaw": "Inspector only methods",
          "name": "inspector_only_methods",
          "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])`",
              "type": "method",
              "name": "profile",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`label` {string}",
                      "name": "label",
                      "type": "string"
                    }
                  ]
                }
              ],
              "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=\"console.html#console_console_profileend_label\"><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])`",
              "type": "method",
              "name": "profileEnd",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`label` {string}",
                      "name": "label",
                      "type": "string"
                    }
                  ]
                }
              ],
              "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=\"console.html#console_console_profile_label\"><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])`",
              "type": "method",
              "name": "timeStamp",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`label` {string}",
                      "name": "label",
                      "type": "string"
                    }
                  ]
                }
              ],
              "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>"
            }
          ],
          "type": "module",
          "displayName": "Inspector only methods"
        }
      ],
      "type": "module",
      "displayName": "Console"
    },
    {
      "textRaw": "Crypto",
      "name": "crypto",
      "introduced_in": "v0.3.6",
      "stability": 2,
      "stabilityText": "Stable",
      "desc": "<p>The <code>crypto</code> module provides cryptographic functionality that includes a set of\nwrappers for OpenSSL's hash, HMAC, cipher, decipher, sign, and verify functions.</p>\n<p>Use <code>require('crypto')</code> to access this module.</p>\n<pre><code class=\"language-js\">const crypto = require('crypto');\n\nconst secret = 'abcdefg';\nconst hash = crypto.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",
          "desc": "<p>It is possible for Node.js to be built without including support for the\n<code>crypto</code> module. In such cases, calling <code>require('crypto')</code> will result in an\nerror being thrown.</p>\n<pre><code class=\"language-js\">let crypto;\ntry {\n  crypto = require('crypto');\n} catch (err) {\n  console.log('crypto support is disabled!');\n}\n</code></pre>",
          "type": "module",
          "displayName": "Determining if crypto support is unavailable"
        },
        {
          "textRaw": "`crypto` module methods and properties",
          "name": "`crypto`_module_methods_and_properties",
          "properties": [
            {
              "textRaw": "`constants` Returns: {Object} An object containing commonly used constants for crypto and security related operations. The specific constants currently defined are described in [Crypto constants][].",
              "type": "Object",
              "name": "return",
              "meta": {
                "added": [
                  "v6.3.0"
                ],
                "changes": []
              },
              "desc": "An object containing commonly used constants for crypto and security related operations. The specific constants currently defined are described in [Crypto constants][]."
            },
            {
              "textRaw": "`crypto.DEFAULT_ENCODING`",
              "name": "DEFAULT_ENCODING",
              "meta": {
                "added": [
                  "v0.9.3"
                ],
                "deprecated": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "stability": 0,
              "stabilityText": "Deprecated",
              "desc": "<p>The default encoding to use for functions that can take either strings\nor <a href=\"buffer.html\">buffers</a>. The default value is <code>'buffer'</code>, which makes methods\ndefault to <a href=\"buffer.html\"><code>Buffer</code></a> objects.</p>\n<p>The <code>crypto.DEFAULT_ENCODING</code> mechanism is provided for backwards compatibility\nwith legacy programs that expect <code>'latin1'</code> to be the default encoding.</p>\n<p>New applications should expect the default to be <code>'buffer'</code>.</p>\n<p>This property is deprecated.</p>"
            },
            {
              "textRaw": "`crypto.fips`",
              "name": "fips",
              "meta": {
                "added": [
                  "v6.0.0"
                ],
                "deprecated": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "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>"
            }
          ],
          "methods": [
            {
              "textRaw": "`crypto.createCipher(algorithm, password[, options])`",
              "type": "method",
              "name": "createCipher",
              "meta": {
                "added": [
                  "v0.1.94"
                ],
                "deprecated": [
                  "v10.0.0"
                ],
                "changes": [
                  {
                    "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."
                  }
                ]
              },
              "stability": 0,
              "stabilityText": "Deprecated: Use [`crypto.createCipheriv()`][] instead.",
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Cipher}",
                    "name": "return",
                    "type": "Cipher"
                  },
                  "params": [
                    {
                      "textRaw": "`algorithm` {string}",
                      "name": "algorithm",
                      "type": "string"
                    },
                    {
                      "textRaw": "`password` {string | Buffer | TypedArray | DataView}",
                      "name": "password",
                      "type": "string | Buffer | TypedArray | DataView"
                    },
                    {
                      "textRaw": "`options` {Object} [`stream.transform` options][]",
                      "name": "options",
                      "type": "Object",
                      "desc": "[`stream.transform` options][]"
                    }
                  ]
                }
              ],
              "desc": "<p>Creates and returns a <code>Cipher</code> object that uses the given <code>algorithm</code> and\n<code>password</code>.</p>\n<p>The <code>options</code> argument controls stream behavior and is optional except when a\ncipher in CCM or OCB mode is used (e.g. <code>'aes-128-ccm'</code>). In that case, the\n<code>authTagLength</code> option is required and specifies the length of the\nauthentication tag in bytes, see <a href=\"crypto.html#crypto_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.</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>\n(<code>openssl list-cipher-algorithms</code> for older versions of OpenSSL) will\ndisplay the available cipher algorithms.</p>\n<p>The <code>password</code> is used to derive the cipher key and initialization vector (IV).\nThe value must be either a <code>'latin1'</code> encoded string, a <a href=\"buffer.html\"><code>Buffer</code></a>, a\n<code>TypedArray</code>, or a <code>DataView</code>.</p>\n<p>The implementation of <code>crypto.createCipher()</code> derives keys using the OpenSSL\nfunction <a href=\"https://www.openssl.org/docs/man1.1.0/crypto/EVP_BytesToKey.html\"><code>EVP_BytesToKey</code></a> with the digest algorithm set to MD5, one\niteration, and no salt. The lack of salt allows dictionary attacks as the same\npassword always creates the same key. The low iteration count and\nnon-cryptographically secure hash algorithm allow passwords to be tested very\nrapidly.</p>\n<p>In line with OpenSSL's recommendation to use a more modern algorithm instead of\n<a href=\"https://www.openssl.org/docs/man1.1.0/crypto/EVP_BytesToKey.html\"><code>EVP_BytesToKey</code></a> it is recommended that developers derive a key and IV on\ntheir own using <a href=\"crypto.html#crypto_crypto_scrypt_password_salt_keylen_options_callback\"><code>crypto.scrypt()</code></a> and to use <a href=\"crypto.html#crypto_crypto_createcipheriv_algorithm_key_iv_options\"><code>crypto.createCipheriv()</code></a>\nto create the <code>Cipher</code> object. Users should not use ciphers with counter mode\n(e.g. CTR, GCM, or CCM) in <code>crypto.createCipher()</code>. A warning is emitted when\nthey are used in order to avoid the risk of IV reuse that causes\nvulnerabilities. For the case when IV is reused in GCM, see <a href=\"https://github.com/nonce-disrespect/nonce-disrespect\">Nonce-Disrespecting\nAdversaries</a> for details.</p>"
            },
            {
              "textRaw": "`crypto.createCipheriv(algorithm, key, iv[, options])`",
              "type": "method",
              "name": "createCipheriv",
              "meta": {
                "added": [
                  "v0.1.94"
                ],
                "changes": [
                  {
                    "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",
                    "pr-url": "https://github.com/nodejs/node/pull/24081",
                    "description": "The cipher `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": [
                {
                  "return": {
                    "textRaw": "Returns: {Cipher}",
                    "name": "return",
                    "type": "Cipher"
                  },
                  "params": [
                    {
                      "textRaw": "`algorithm` {string}",
                      "name": "algorithm",
                      "type": "string"
                    },
                    {
                      "textRaw": "`key` {string | Buffer | TypedArray | DataView | KeyObject}",
                      "name": "key",
                      "type": "string | Buffer | TypedArray | DataView | KeyObject"
                    },
                    {
                      "textRaw": "`iv` {string | Buffer | TypedArray | DataView | null}",
                      "name": "iv",
                      "type": "string | Buffer | TypedArray | DataView | null"
                    },
                    {
                      "textRaw": "`options` {Object} [`stream.transform` options][]",
                      "name": "options",
                      "type": "Object",
                      "desc": "[`stream.transform` options][]"
                    }
                  ]
                }
              ],
              "desc": "<p>Creates and returns a <code>Cipher</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 is used (e.g. <code>'aes-128-ccm'</code>). In that case, the\n<code>authTagLength</code> option is required and specifies the length of the\nauthentication tag in bytes, see <a href=\"crypto.html#crypto_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.</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>\n(<code>openssl list-cipher-algorithms</code> for older versions of OpenSSL) 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=\"crypto.html#crypto_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>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.createDecipher(algorithm, password[, options])`",
              "type": "method",
              "name": "createDecipher",
              "meta": {
                "added": [
                  "v0.1.94"
                ],
                "deprecated": [
                  "v10.0.0"
                ],
                "changes": [
                  {
                    "version": "v10.10.0",
                    "pr-url": "https://github.com/nodejs/node/pull/21447",
                    "description": "Ciphers in OCB mode are now supported."
                  }
                ]
              },
              "stability": 0,
              "stabilityText": "Deprecated: Use [`crypto.createDecipheriv()`][] instead.",
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Decipher}",
                    "name": "return",
                    "type": "Decipher"
                  },
                  "params": [
                    {
                      "textRaw": "`algorithm` {string}",
                      "name": "algorithm",
                      "type": "string"
                    },
                    {
                      "textRaw": "`password` {string | Buffer | TypedArray | DataView}",
                      "name": "password",
                      "type": "string | Buffer | TypedArray | DataView"
                    },
                    {
                      "textRaw": "`options` {Object} [`stream.transform` options][]",
                      "name": "options",
                      "type": "Object",
                      "desc": "[`stream.transform` options][]"
                    }
                  ]
                }
              ],
              "desc": "<p>Creates and returns a <code>Decipher</code> object that uses the given <code>algorithm</code> and\n<code>password</code> (key).</p>\n<p>The <code>options</code> argument controls stream behavior and is optional except when a\ncipher in CCM or OCB mode is used (e.g. <code>'aes-128-ccm'</code>). In that case, the\n<code>authTagLength</code> option is required and specifies the length of the\nauthentication tag in bytes, see <a href=\"crypto.html#crypto_ccm_mode\">CCM mode</a>.</p>\n<p>The implementation of <code>crypto.createDecipher()</code> derives keys using the OpenSSL\nfunction <a href=\"https://www.openssl.org/docs/man1.1.0/crypto/EVP_BytesToKey.html\"><code>EVP_BytesToKey</code></a> with the digest algorithm set to MD5, one\niteration, and no salt. The lack of salt allows dictionary attacks as the same\npassword always creates the same key. The low iteration count and\nnon-cryptographically secure hash algorithm allow passwords to be tested very\nrapidly.</p>\n<p>In line with OpenSSL's recommendation to use a more modern algorithm instead of\n<a href=\"https://www.openssl.org/docs/man1.1.0/crypto/EVP_BytesToKey.html\"><code>EVP_BytesToKey</code></a> it is recommended that developers derive a key and IV on\ntheir own using <a href=\"crypto.html#crypto_crypto_scrypt_password_salt_keylen_options_callback\"><code>crypto.scrypt()</code></a> and to use <a href=\"crypto.html#crypto_crypto_createdecipheriv_algorithm_key_iv_options\"><code>crypto.createDecipheriv()</code></a>\nto create the <code>Decipher</code> object.</p>"
            },
            {
              "textRaw": "`crypto.createDecipheriv(algorithm, key, iv[, options])`",
              "type": "method",
              "name": "createDecipheriv",
              "meta": {
                "added": [
                  "v0.1.94"
                ],
                "changes": [
                  {
                    "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",
                    "pr-url": "https://github.com/nodejs/node/pull/24081",
                    "description": "The cipher `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": [
                {
                  "return": {
                    "textRaw": "Returns: {Decipher}",
                    "name": "return",
                    "type": "Decipher"
                  },
                  "params": [
                    {
                      "textRaw": "`algorithm` {string}",
                      "name": "algorithm",
                      "type": "string"
                    },
                    {
                      "textRaw": "`key` {string | Buffer | TypedArray | DataView | KeyObject}",
                      "name": "key",
                      "type": "string | Buffer | TypedArray | DataView | KeyObject"
                    },
                    {
                      "textRaw": "`iv` {string | Buffer | TypedArray | DataView | null}",
                      "name": "iv",
                      "type": "string | Buffer | TypedArray | DataView | null"
                    },
                    {
                      "textRaw": "`options` {Object} [`stream.transform` options][]",
                      "name": "options",
                      "type": "Object",
                      "desc": "[`stream.transform` options][]"
                    }
                  ]
                }
              ],
              "desc": "<p>Creates and returns a <code>Decipher</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 is used (e.g. <code>'aes-128-ccm'</code>). In that case, the\n<code>authTagLength</code> option is required and specifies the length of the\nauthentication tag in bytes, see <a href=\"crypto.html#crypto_ccm_mode\">CCM mode</a>. In GCM mode, the <code>authTagLength</code>\noption is not required but can be used to restrict accepted authentication tags\nto those with the specified length.</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>\n(<code>openssl list-cipher-algorithms</code> for older versions of OpenSSL) 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=\"crypto.html#crypto_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>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])`",
              "type": "method",
              "name": "createDiffieHellman",
              "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": [
                {
                  "return": {
                    "textRaw": "Returns: {DiffieHellman}",
                    "name": "return",
                    "type": "DiffieHellman"
                  },
                  "params": [
                    {
                      "textRaw": "`prime` {string | Buffer | TypedArray | DataView}",
                      "name": "prime",
                      "type": "string | Buffer | TypedArray | DataView"
                    },
                    {
                      "textRaw": "`primeEncoding` {string} The [encoding][] of the `prime` string.",
                      "name": "primeEncoding",
                      "type": "string",
                      "desc": "The [encoding][] of the `prime` string."
                    },
                    {
                      "textRaw": "`generator` {number | string | Buffer | TypedArray | DataView} **Default:** `2`",
                      "name": "generator",
                      "type": "number | string | Buffer | TypedArray | DataView",
                      "default": "`2`"
                    },
                    {
                      "textRaw": "`generatorEncoding` {string} The [encoding][] of the `generator` string.",
                      "name": "generatorEncoding",
                      "type": "string",
                      "desc": "The [encoding][] of the `generator` string."
                    }
                  ]
                }
              ],
              "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])`",
              "type": "method",
              "name": "createDiffieHellman",
              "meta": {
                "added": [
                  "v0.5.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {DiffieHellman}",
                    "name": "return",
                    "type": "DiffieHellman"
                  },
                  "params": [
                    {
                      "textRaw": "`primeLength` {number}",
                      "name": "primeLength",
                      "type": "number"
                    },
                    {
                      "textRaw": "`generator` {number} **Default:** `2`",
                      "name": "generator",
                      "type": "number",
                      "default": "`2`"
                    }
                  ]
                }
              ],
              "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)`",
              "type": "method",
              "name": "createDiffieHellmanGroup",
              "meta": {
                "added": [
                  "v0.9.3"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {DiffieHellmanGroup}",
                    "name": "return",
                    "type": "DiffieHellmanGroup"
                  },
                  "params": [
                    {
                      "textRaw": "`name` {string}",
                      "name": "name",
                      "type": "string"
                    }
                  ]
                }
              ],
              "desc": "<p>An alias for <a href=\"crypto.html#crypto_crypto_getdiffiehellman_groupname\"><code>crypto.getDiffieHellman()</code></a></p>"
            },
            {
              "textRaw": "`crypto.createECDH(curveName)`",
              "type": "method",
              "name": "createECDH",
              "meta": {
                "added": [
                  "v0.11.14"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {ECDH}",
                    "name": "return",
                    "type": "ECDH"
                  },
                  "params": [
                    {
                      "textRaw": "`curveName` {string}",
                      "name": "curveName",
                      "type": "string"
                    }
                  ]
                }
              ],
              "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=\"crypto.html#crypto_crypto_getcurves\"><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])`",
              "type": "method",
              "name": "createHash",
              "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": [
                {
                  "return": {
                    "textRaw": "Returns: {Hash}",
                    "name": "return",
                    "type": "Hash"
                  },
                  "params": [
                    {
                      "textRaw": "`algorithm` {string}",
                      "name": "algorithm",
                      "type": "string"
                    },
                    {
                      "textRaw": "`options` {Object} [`stream.transform` options][]",
                      "name": "options",
                      "type": "Object",
                      "desc": "[`stream.transform` options][]"
                    }
                  ]
                }
              ],
              "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>\n(<code>openssl list-message-digest-algorithms</code> for older versions of OpenSSL) will\ndisplay the available digest algorithms.</p>\n<p>Example: generating the sha256 sum of a file</p>\n<pre><code class=\"language-js\">const filename = process.argv[2];\nconst crypto = require('crypto');\nconst fs = require('fs');\n\nconst hash = crypto.createHash('sha256');\n\nconst input = fs.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])`",
              "type": "method",
              "name": "createHmac",
              "meta": {
                "added": [
                  "v0.1.94"
                ],
                "changes": [
                  {
                    "version": "v11.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/24234",
                    "description": "The `key` argument can now be a `KeyObject`."
                  }
                ]
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Hmac}",
                    "name": "return",
                    "type": "Hmac"
                  },
                  "params": [
                    {
                      "textRaw": "`algorithm` {string}",
                      "name": "algorithm",
                      "type": "string"
                    },
                    {
                      "textRaw": "`key` {string | Buffer | TypedArray | DataView | KeyObject}",
                      "name": "key",
                      "type": "string | Buffer | TypedArray | DataView | KeyObject"
                    },
                    {
                      "textRaw": "`options` {Object} [`stream.transform` options][]",
                      "name": "options",
                      "type": "Object",
                      "desc": "[`stream.transform` options][]"
                    }
                  ]
                }
              ],
              "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>\n(<code>openssl list-message-digest-algorithms</code> for older versions of OpenSSL) 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=\"crypto.html#crypto_class_keyobject\"><code>KeyObject</code></a>, its type must be <code>secret</code>.</p>\n<p>Example: generating the sha256 HMAC of a file</p>\n<pre><code class=\"language-js\">const filename = process.argv[2];\nconst crypto = require('crypto');\nconst fs = require('fs');\n\nconst hmac = crypto.createHmac('sha256', 'a secret');\n\nconst input = fs.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)`",
              "type": "method",
              "name": "createPrivateKey",
              "meta": {
                "added": [
                  "v11.6.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {KeyObject}",
                    "name": "return",
                    "type": "KeyObject"
                  },
                  "params": [
                    {
                      "textRaw": "`key` {Object | string | Buffer}",
                      "name": "key",
                      "type": "Object | string | Buffer",
                      "options": [
                        {
                          "textRaw": "`key`: {string | Buffer} The key material, either in PEM or DER format.",
                          "name": "key",
                          "type": "string | Buffer",
                          "desc": "The key material, either in PEM or DER format."
                        },
                        {
                          "textRaw": "`format`: {string} Must be `'pem'` or `'der'`. **Default:** `'pem'`.",
                          "name": "format",
                          "type": "string",
                          "default": "`'pem'`",
                          "desc": "Must be `'pem'` or `'der'`."
                        },
                        {
                          "textRaw": "`type`: {string} Must be `'pkcs1'`, `'pkcs8'` or `'sec1'`. This option is required only if the `format` is `'der'` and ignored if it is `'pem'`.",
                          "name": "type",
                          "type": "string",
                          "desc": "Must be `'pkcs1'`, `'pkcs8'` or `'sec1'`. This option is required only if the `format` is `'der'` and ignored if it is `'pem'`."
                        },
                        {
                          "textRaw": "`passphrase`: {string | Buffer} The passphrase to use for decryption.",
                          "name": "passphrase",
                          "type": "string | Buffer",
                          "desc": "The passphrase to use for decryption."
                        }
                      ]
                    }
                  ]
                }
              ],
              "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)`",
              "type": "method",
              "name": "createPublicKey",
              "meta": {
                "added": [
                  "v11.6.0"
                ],
                "changes": [
                  {
                    "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": [
                {
                  "return": {
                    "textRaw": "Returns: {KeyObject}",
                    "name": "return",
                    "type": "KeyObject"
                  },
                  "params": [
                    {
                      "textRaw": "`key` {Object | string | Buffer | KeyObject}",
                      "name": "key",
                      "type": "Object | string | Buffer | KeyObject",
                      "options": [
                        {
                          "textRaw": "`key`: {string | Buffer}",
                          "name": "key",
                          "type": "string | Buffer"
                        },
                        {
                          "textRaw": "`format`: {string} Must be `'pem'` or `'der'`. **Default:** `'pem'`.",
                          "name": "format",
                          "type": "string",
                          "default": "`'pem'`",
                          "desc": "Must be `'pem'` or `'der'`."
                        },
                        {
                          "textRaw": "`type`: {string} Must be `'pkcs1'` or `'spki'`. This option is required only if the `format` is `'der'`.",
                          "name": "type",
                          "type": "string",
                          "desc": "Must be `'pkcs1'` or `'spki'`. This option is required only if the `format` is `'der'`."
                        }
                      ]
                    }
                  ]
                }
              ],
              "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=\"crypto.html#crypto_crypto_createprivatekey_key\"><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)`",
              "type": "method",
              "name": "createSecretKey",
              "meta": {
                "added": [
                  "v11.6.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {KeyObject}",
                    "name": "return",
                    "type": "KeyObject"
                  },
                  "params": [
                    {
                      "textRaw": "`key` {Buffer}",
                      "name": "key",
                      "type": "Buffer"
                    }
                  ]
                }
              ],
              "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])`",
              "type": "method",
              "name": "createSign",
              "meta": {
                "added": [
                  "v0.1.92"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Sign}",
                    "name": "return",
                    "type": "Sign"
                  },
                  "params": [
                    {
                      "textRaw": "`algorithm` {string}",
                      "name": "algorithm",
                      "type": "string"
                    },
                    {
                      "textRaw": "`options` {Object} [`stream.Writable` options][]",
                      "name": "options",
                      "type": "Object",
                      "desc": "[`stream.Writable` options][]"
                    }
                  ]
                }
              ],
              "desc": "<p>Creates and returns a <code>Sign</code> object that uses the given <code>algorithm</code>. Use\n<a href=\"crypto.html#crypto_crypto_gethashes\"><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])`",
              "type": "method",
              "name": "createVerify",
              "meta": {
                "added": [
                  "v0.1.92"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Verify}",
                    "name": "return",
                    "type": "Verify"
                  },
                  "params": [
                    {
                      "textRaw": "`algorithm` {string}",
                      "name": "algorithm",
                      "type": "string"
                    },
                    {
                      "textRaw": "`options` {Object} [`stream.Writable` options][]",
                      "name": "options",
                      "type": "Object",
                      "desc": "[`stream.Writable` options][]"
                    }
                  ]
                }
              ],
              "desc": "<p>Creates and returns a <code>Verify</code> object that uses the given algorithm.\nUse <a href=\"crypto.html#crypto_crypto_gethashes\"><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.diffieHellman(options)`",
              "type": "method",
              "name": "diffieHellman",
              "meta": {
                "added": [
                  "v12.17.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Buffer}",
                    "name": "return",
                    "type": "Buffer"
                  },
                  "params": [
                    {
                      "textRaw": "`options`: {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`privateKey`: {KeyObject}",
                          "name": "privateKey",
                          "type": "KeyObject"
                        },
                        {
                          "textRaw": "`publicKey`: {KeyObject}",
                          "name": "publicKey",
                          "type": "KeyObject"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Computes the Diffie-Hellman secret based on a <code>privateKey</code> and a <code>publicKey</code>.\nBoth keys must have the same <code>asymmetricKeyType</code>, which must be one of <code>'dh'</code>\n(for Diffie-Hellman), <code>'ec'</code> (for ECDH), <code>'x448'</code>, or <code>'x25519'</code> (for ECDH-ES).</p>"
            },
            {
              "textRaw": "`crypto.generateKeyPair(type, options, callback)`",
              "type": "method",
              "name": "generateKeyPair",
              "meta": {
                "added": [
                  "v10.12.0"
                ],
                "changes": [
                  {
                    "version": "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/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} Must be `'rsa'`, `'dsa'`, `'ec'`, `'ed25519'`, `'ed448'`, `'x25519'`, `'x448'`, or `'dh'`.",
                      "name": "type",
                      "type": "string",
                      "desc": "Must be `'rsa'`, `'dsa'`, `'ec'`, `'ed25519'`, `'ed448'`, `'x25519'`, `'x448'`, or `'dh'`."
                    },
                    {
                      "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": "`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": "`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>. RSA, DSA, EC, Ed25519,\nEd448, X25519, X448, and DH are currently supported.</p>\n<p>If a <code>publicKeyEncoding</code> or <code>privateKeyEncoding</code> was specified, this function\nbehaves as if <a href=\"crypto.html#crypto_keyobject_export_options\"><code>keyObject.export()</code></a> had been called on its result. Otherwise,\nthe respective part of the key is returned as a <a href=\"crypto.html#crypto_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-js\">const { generateKeyPair } = require('crypto');\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#util_util_promisify_original\"><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)`",
              "type": "method",
              "name": "generateKeyPairSync",
              "meta": {
                "added": [
                  "v10.12.0"
                ],
                "changes": [
                  {
                    "version": "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/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": [
                {
                  "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"
                      }
                    ]
                  },
                  "params": [
                    {
                      "textRaw": "`type`: {string} Must be `'rsa'`, `'dsa'`, `'ec'`, `'ed25519'`, `'ed448'`, `'x25519'`, `'x448'`, or `'dh'`.",
                      "name": "type",
                      "type": "string",
                      "desc": "Must be `'rsa'`, `'dsa'`, `'ec'`, `'ed25519'`, `'ed448'`, `'x25519'`, `'x448'`, or `'dh'`."
                    },
                    {
                      "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": "`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": "`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()`][]."
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Generates a new asymmetric key pair of the given <code>type</code>. RSA, DSA, EC, Ed25519,\nEd448, X25519, X448, and DH are currently supported.</p>\n<p>If a <code>publicKeyEncoding</code> or <code>privateKeyEncoding</code> was specified, this function\nbehaves as if <a href=\"crypto.html#crypto_keyobject_export_options\"><code>keyObject.export()</code></a> had been called on its result. Otherwise,\nthe respective part of the key is returned as a <a href=\"crypto.html#crypto_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-js\">const { generateKeyPairSync } = require('crypto');\nconst { publicKey, privateKey } = 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.getCiphers()`",
              "type": "method",
              "name": "getCiphers",
              "meta": {
                "added": [
                  "v0.9.3"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "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."
                  },
                  "params": []
                }
              ],
              "desc": "<pre><code class=\"language-js\">const ciphers = crypto.getCiphers();\nconsole.log(ciphers); // ['aes-128-cbc', 'aes-128-ccm', ...]\n</code></pre>"
            },
            {
              "textRaw": "`crypto.getCurves()`",
              "type": "method",
              "name": "getCurves",
              "meta": {
                "added": [
                  "v2.3.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "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."
                  },
                  "params": []
                }
              ],
              "desc": "<pre><code class=\"language-js\">const curves = crypto.getCurves();\nconsole.log(curves); // ['Oakley-EC2N-3', 'Oakley-EC2N-4', ...]\n</code></pre>"
            },
            {
              "textRaw": "`crypto.getDiffieHellman(groupName)`",
              "type": "method",
              "name": "getDiffieHellman",
              "meta": {
                "added": [
                  "v0.7.5"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {DiffieHellmanGroup}",
                    "name": "return",
                    "type": "DiffieHellmanGroup"
                  },
                  "params": [
                    {
                      "textRaw": "`groupName` {string}",
                      "name": "groupName",
                      "type": "string"
                    }
                  ]
                }
              ],
              "desc": "<p>Creates a predefined <code>DiffieHellmanGroup</code> key exchange object. The\nsupported groups are: <code>'modp1'</code>, <code>'modp2'</code>, <code>'modp5'</code> (defined in\n<a href=\"https://www.rfc-editor.org/rfc/rfc2412.txt\">RFC 2412</a>, but see <a href=\"crypto.html#crypto_support_for_weak_or_compromised_algorithms\">Caveats</a>) and <code>'modp14'</code>, <code>'modp15'</code>,\n<code>'modp16'</code>, <code>'modp17'</code>, <code>'modp18'</code> (defined in <a href=\"https://www.rfc-editor.org/rfc/rfc3526.txt\">RFC 3526</a>). The\nreturned object mimics the interface of objects created by\n<a href=\"crypto.html#crypto_crypto_creatediffiehellman_prime_primeencoding_generator_generatorencoding\"><code>crypto.createDiffieHellman()</code></a>, but will not allow changing\nthe keys (with <a href=\"crypto.html#crypto_diffiehellman_setpublickey_publickey_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-js\">const crypto = require('crypto');\nconst alice = crypto.getDiffieHellman('modp14');\nconst bob = crypto.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()`",
              "type": "method",
              "name": "getFips",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "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}."
                  },
                  "params": []
                }
              ]
            },
            {
              "textRaw": "`crypto.getHashes()`",
              "type": "method",
              "name": "getHashes",
              "meta": {
                "added": [
                  "v0.9.3"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "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."
                  },
                  "params": []
                }
              ],
              "desc": "<pre><code class=\"language-js\">const hashes = crypto.getHashes();\nconsole.log(hashes); // ['DSA', 'DSA-SHA', 'DSA-SHA1', ...]\n</code></pre>"
            },
            {
              "textRaw": "`crypto.pbkdf2(password, salt, iterations, keylen, digest, callback)`",
              "type": "method",
              "name": "pbkdf2",
              "meta": {
                "added": [
                  "v0.5.5"
                ],
                "changes": [
                  {
                    "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|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"
                    },
                    {
                      "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>If <code>digest</code> is <code>null</code>, <code>'sha1'</code> will be used. This behavior is deprecated,\nplease specify a <code>digest</code> explicitly.</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<pre><code class=\"language-js\">const crypto = require('crypto');\ncrypto.pbkdf2('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>The <code>crypto.DEFAULT_ENCODING</code> property can be used to change the way the\n<code>derivedKey</code> is passed to the callback. This property, however, has been\ndeprecated and use should be avoided.</p>\n<pre><code class=\"language-js\">const crypto = require('crypto');\ncrypto.DEFAULT_ENCODING = 'hex';\ncrypto.pbkdf2('secret', 'salt', 100000, 512, 'sha512', (err, derivedKey) => {\n  if (err) throw err;\n  console.log(derivedKey);  // '3745e48...aa39b34'\n});\n</code></pre>\n<p>An array of supported digest functions can be retrieved using\n<a href=\"crypto.html#crypto_crypto_gethashes\"><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#cli_uv_threadpool_size_size\"><code>UV_THREADPOOL_SIZE</code></a> documentation for more information.</p>"
            },
            {
              "textRaw": "`crypto.pbkdf2Sync(password, salt, iterations, keylen, digest)`",
              "type": "method",
              "name": "pbkdf2Sync",
              "meta": {
                "added": [
                  "v0.9.3"
                ],
                "changes": [
                  {
                    "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": [
                {
                  "return": {
                    "textRaw": "Returns: {Buffer}",
                    "name": "return",
                    "type": "Buffer"
                  },
                  "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"
                    }
                  ]
                }
              ],
              "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>If <code>digest</code> is <code>null</code>, <code>'sha1'</code> will be used. This behavior is deprecated,\nplease specify a <code>digest</code> explicitly.</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<pre><code class=\"language-js\">const crypto = require('crypto');\nconst key = crypto.pbkdf2Sync('secret', 'salt', 100000, 64, 'sha512');\nconsole.log(key.toString('hex'));  // '3745e48...08d59ae'\n</code></pre>\n<p>The <code>crypto.DEFAULT_ENCODING</code> property may be used to change the way the\n<code>derivedKey</code> is returned. This property, however, is deprecated and use\nshould be avoided.</p>\n<pre><code class=\"language-js\">const crypto = require('crypto');\ncrypto.DEFAULT_ENCODING = 'hex';\nconst key = crypto.pbkdf2Sync('secret', 'salt', 100000, 512, 'sha512');\nconsole.log(key);  // '3745e48...aa39b34'\n</code></pre>\n<p>An array of supported digest functions can be retrieved using\n<a href=\"crypto.html#crypto_crypto_gethashes\"><code>crypto.getHashes()</code></a>.</p>"
            },
            {
              "textRaw": "`crypto.privateDecrypt(privateKey, buffer)`",
              "type": "method",
              "name": "privateDecrypt",
              "meta": {
                "added": [
                  "v0.11.14"
                ],
                "changes": [
                  {
                    "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": [
                {
                  "return": {
                    "textRaw": "Returns: {Buffer} A new `Buffer` with the decrypted content.",
                    "name": "return",
                    "type": "Buffer",
                    "desc": "A new `Buffer` with the decrypted content."
                  },
                  "params": [
                    {
                      "textRaw": "`privateKey` {Object | string | Buffer | KeyObject}",
                      "name": "privateKey",
                      "type": "Object | string | Buffer | KeyObject",
                      "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` {Buffer | TypedArray | DataView} The label to use for OAEP padding. If not specified, no label is used.",
                          "name": "oaepLabel",
                          "type": "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` {Buffer | TypedArray | DataView}",
                      "name": "buffer",
                      "type": "Buffer | TypedArray | DataView"
                    }
                  ]
                }
              ],
              "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=\"crypto.html#crypto_crypto_publicencrypt_key_buffer\"><code>crypto.publicEncrypt()</code></a>.</p>\n<p>If <code>privateKey</code> is not a <a href=\"crypto.html#crypto_class_keyobject\"><code>KeyObject</code></a>, this function behaves as if\n<code>privateKey</code> had been passed to <a href=\"crypto.html#crypto_crypto_createprivatekey_key\"><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>"
            },
            {
              "textRaw": "`crypto.privateEncrypt(privateKey, buffer)`",
              "type": "method",
              "name": "privateEncrypt",
              "meta": {
                "added": [
                  "v1.1.0"
                ],
                "changes": [
                  {
                    "version": "v11.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/24234",
                    "description": "This function now supports key objects."
                  }
                ]
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Buffer} A new `Buffer` with the encrypted content.",
                    "name": "return",
                    "type": "Buffer",
                    "desc": "A new `Buffer` with the encrypted content."
                  },
                  "params": [
                    {
                      "textRaw": "`privateKey` {Object | string | Buffer | KeyObject}",
                      "name": "privateKey",
                      "type": "Object | string | Buffer | KeyObject",
                      "options": [
                        {
                          "textRaw": "`key` {string | Buffer | KeyObject} A PEM encoded private key.",
                          "name": "key",
                          "type": "string | Buffer | KeyObject",
                          "desc": "A PEM encoded private key."
                        },
                        {
                          "textRaw": "`passphrase` {string | Buffer} An optional passphrase for the private key.",
                          "name": "passphrase",
                          "type": "string | Buffer",
                          "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": "`buffer` {Buffer | TypedArray | DataView}",
                      "name": "buffer",
                      "type": "Buffer | TypedArray | DataView"
                    }
                  ]
                }
              ],
              "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=\"crypto.html#crypto_crypto_publicdecrypt_key_buffer\"><code>crypto.publicDecrypt()</code></a>.</p>\n<p>If <code>privateKey</code> is not a <a href=\"crypto.html#crypto_class_keyobject\"><code>KeyObject</code></a>, this function behaves as if\n<code>privateKey</code> had been passed to <a href=\"crypto.html#crypto_crypto_createprivatekey_key\"><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)`",
              "type": "method",
              "name": "publicDecrypt",
              "meta": {
                "added": [
                  "v1.1.0"
                ],
                "changes": [
                  {
                    "version": "v11.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/24234",
                    "description": "This function now supports key objects."
                  }
                ]
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Buffer} A new `Buffer` with the decrypted content.",
                    "name": "return",
                    "type": "Buffer",
                    "desc": "A new `Buffer` with the decrypted content."
                  },
                  "params": [
                    {
                      "textRaw": "`key` {Object | string | Buffer | KeyObject}",
                      "name": "key",
                      "type": "Object | string | Buffer | KeyObject",
                      "options": [
                        {
                          "textRaw": "`passphrase` {string | Buffer} An optional passphrase for the private key.",
                          "name": "passphrase",
                          "type": "string | Buffer",
                          "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": "`buffer` {Buffer | TypedArray | DataView}",
                      "name": "buffer",
                      "type": "Buffer | TypedArray | DataView"
                    }
                  ]
                }
              ],
              "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=\"crypto.html#crypto_crypto_privateencrypt_privatekey_buffer\"><code>crypto.privateEncrypt()</code></a>.</p>\n<p>If <code>key</code> is not a <a href=\"crypto.html#crypto_class_keyobject\"><code>KeyObject</code></a>, this function behaves as if\n<code>key</code> had been passed to <a href=\"crypto.html#crypto_crypto_createpublickey_key\"><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)`",
              "type": "method",
              "name": "publicEncrypt",
              "meta": {
                "added": [
                  "v0.11.14"
                ],
                "changes": [
                  {
                    "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": [
                {
                  "return": {
                    "textRaw": "Returns: {Buffer} A new `Buffer` with the encrypted content.",
                    "name": "return",
                    "type": "Buffer",
                    "desc": "A new `Buffer` with the encrypted content."
                  },
                  "params": [
                    {
                      "textRaw": "`key` {Object | string | Buffer | KeyObject}",
                      "name": "key",
                      "type": "Object | string | Buffer | KeyObject",
                      "options": [
                        {
                          "textRaw": "`key` {string | Buffer | KeyObject} A PEM encoded public or private key.",
                          "name": "key",
                          "type": "string | Buffer | KeyObject",
                          "desc": "A PEM encoded public or private key."
                        },
                        {
                          "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` {Buffer | TypedArray | DataView} The label to use for OAEP padding. If not specified, no label is used.",
                          "name": "oaepLabel",
                          "type": "Buffer | TypedArray | DataView",
                          "desc": "The label to use for OAEP padding. If not specified, no label is used."
                        },
                        {
                          "textRaw": "`passphrase` {string | Buffer} An optional passphrase for the private key.",
                          "name": "passphrase",
                          "type": "string | Buffer",
                          "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": "`buffer` {Buffer | TypedArray | DataView}",
                      "name": "buffer",
                      "type": "Buffer | TypedArray | DataView"
                    }
                  ]
                }
              ],
              "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=\"crypto.html#crypto_crypto_privatedecrypt_privatekey_buffer\"><code>crypto.privateDecrypt()</code></a>.</p>\n<p>If <code>key</code> is not a <a href=\"crypto.html#crypto_class_keyobject\"><code>KeyObject</code></a>, this function behaves as if\n<code>key</code> had been passed to <a href=\"crypto.html#crypto_crypto_createpublickey_key\"><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])`",
              "type": "method",
              "name": "randomBytes",
              "meta": {
                "added": [
                  "v0.5.8"
                ],
                "changes": [
                  {
                    "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": [
                {
                  "return": {
                    "textRaw": "Returns: {Buffer} if the `callback` function is not provided.",
                    "name": "return",
                    "type": "Buffer",
                    "desc": "if the `callback` function is not provided."
                  },
                  "params": [
                    {
                      "textRaw": "`size` {number}",
                      "name": "size",
                      "type": "number"
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        },
                        {
                          "textRaw": "`buf` {Buffer}",
                          "name": "buf",
                          "type": "Buffer"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Generates cryptographically strong pseudo-random 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-js\">// Asynchronous\nconst crypto = require('crypto');\ncrypto.randomBytes(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-js\">// Synchronous\nconst buf = crypto.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#cli_uv_threadpool_size_size\"><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.randomFillSync(buffer[, offset][, size])`",
              "type": "method",
              "name": "randomFillSync",
              "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": [
                {
                  "return": {
                    "textRaw": "Returns: {Buffer|TypedArray|DataView} The object passed as `buffer` argument.",
                    "name": "return",
                    "type": "Buffer|TypedArray|DataView",
                    "desc": "The object passed as `buffer` argument."
                  },
                  "params": [
                    {
                      "textRaw": "`buffer` {Buffer|TypedArray|DataView} Must be supplied.",
                      "name": "buffer",
                      "type": "Buffer|TypedArray|DataView",
                      "desc": "Must be supplied."
                    },
                    {
                      "textRaw": "`offset` {number} **Default:** `0`",
                      "name": "offset",
                      "type": "number",
                      "default": "`0`"
                    },
                    {
                      "textRaw": "`size` {number} **Default:** `buffer.length - offset`",
                      "name": "size",
                      "type": "number",
                      "default": "`buffer.length - offset`"
                    }
                  ]
                }
              ],
              "desc": "<p>Synchronous version of <a href=\"crypto.html#crypto_crypto_randomfill_buffer_offset_size_callback\"><code>crypto.randomFill()</code></a>.</p>\n<pre><code class=\"language-js\">const buf = Buffer.alloc(10);\nconsole.log(crypto.randomFillSync(buf).toString('hex'));\n\ncrypto.randomFillSync(buf, 5);\nconsole.log(buf.toString('hex'));\n\n// The above is equivalent to the following:\ncrypto.randomFillSync(buf, 5, 5);\nconsole.log(buf.toString('hex'));\n</code></pre>\n<p>Any <code>TypedArray</code> or <code>DataView</code> instance may be passed as <code>buffer</code>.</p>\n<pre><code class=\"language-js\">const a = new Uint32Array(10);\nconsole.log(Buffer.from(crypto.randomFillSync(a).buffer,\n                        a.byteOffset, a.byteLength).toString('hex'));\n\nconst b = new Float64Array(10);\nconsole.log(Buffer.from(crypto.randomFillSync(b).buffer,\n                        b.byteOffset, b.byteLength).toString('hex'));\n\nconst c = new DataView(new ArrayBuffer(10));\nconsole.log(Buffer.from(crypto.randomFillSync(c).buffer,\n                        c.byteOffset, c.byteLength).toString('hex'));\n</code></pre>"
            },
            {
              "textRaw": "`crypto.randomFill(buffer[, offset][, size], callback)`",
              "type": "method",
              "name": "randomFill",
              "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` {Buffer|TypedArray|DataView} Must be supplied.",
                      "name": "buffer",
                      "type": "Buffer|TypedArray|DataView",
                      "desc": "Must be supplied."
                    },
                    {
                      "textRaw": "`offset` {number} **Default:** `0`",
                      "name": "offset",
                      "type": "number",
                      "default": "`0`"
                    },
                    {
                      "textRaw": "`size` {number} **Default:** `buffer.length - offset`",
                      "name": "size",
                      "type": "number",
                      "default": "`buffer.length - offset`"
                    },
                    {
                      "textRaw": "`callback` {Function} `function(err, buf) {}`.",
                      "name": "callback",
                      "type": "Function",
                      "desc": "`function(err, buf) {}`."
                    }
                  ]
                }
              ],
              "desc": "<p>This function is similar to <a href=\"crypto.html#crypto_crypto_randombytes_size_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-js\">const buf = Buffer.alloc(10);\ncrypto.randomFill(buf, (err, buf) => {\n  if (err) throw err;\n  console.log(buf.toString('hex'));\n});\n\ncrypto.randomFill(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:\ncrypto.randomFill(buf, 5, 5, (err, buf) => {\n  if (err) throw err;\n  console.log(buf.toString('hex'));\n});\n</code></pre>\n<p>Any <code>TypedArray</code> or <code>DataView</code> instance may be passed as <code>buffer</code>.</p>\n<pre><code class=\"language-js\">const a = new Uint32Array(10);\ncrypto.randomFill(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 Float64Array(10);\ncrypto.randomFill(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 DataView(new ArrayBuffer(10));\ncrypto.randomFill(c, (err, buf) => {\n  if (err) throw err;\n  console.log(Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength)\n    .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#cli_uv_threadpool_size_size\"><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.scrypt(password, salt, keylen[, options], callback)`",
              "type": "method",
              "name": "scrypt",
              "meta": {
                "added": [
                  "v10.5.0"
                ],
                "changes": [
                  {
                    "version": "v12.8.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`."
                        }
                      ]
                    },
                    {
                      "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>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-js\">const crypto = require('crypto');\n// Using the factory defaults.\ncrypto.scrypt('secret', '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.\ncrypto.scrypt('secret', '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])`",
              "type": "method",
              "name": "scryptSync",
              "meta": {
                "added": [
                  "v10.5.0"
                ],
                "changes": [
                  {
                    "version": "v12.8.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": [
                {
                  "return": {
                    "textRaw": "Returns: {Buffer}",
                    "name": "return",
                    "type": "Buffer"
                  },
                  "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`."
                        }
                      ]
                    }
                  ]
                }
              ],
              "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>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-js\">const crypto = require('crypto');\n// Using the factory defaults.\nconst key1 = crypto.scryptSync('secret', 'salt', 64);\nconsole.log(key1.toString('hex'));  // '3745e48...08d59ae'\n// Using a custom N parameter. Must be a power of two.\nconst key2 = crypto.scryptSync('secret', 'salt', 64, { N: 1024 });\nconsole.log(key2.toString('hex'));  // '3745e48...aa39b34'\n</code></pre>"
            },
            {
              "textRaw": "`crypto.setEngine(engine[, flags])`",
              "type": "method",
              "name": "setEngine",
              "meta": {
                "added": [
                  "v0.11.11"
                ],
                "changes": []
              },
              "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`"
                    }
                  ]
                }
              ],
              "desc": "<p>Load and set the <code>engine</code> for some or all OpenSSL functions (selected by flags).</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>\n<p>The flags below are deprecated in OpenSSL-1.1.0.</p>\n<ul>\n<li><code>crypto.constants.ENGINE_METHOD_ECDH</code></li>\n<li><code>crypto.constants.ENGINE_METHOD_ECDSA</code></li>\n<li><code>crypto.constants.ENGINE_METHOD_STORE</code></li>\n</ul>"
            },
            {
              "textRaw": "`crypto.setFips(bool)`",
              "type": "method",
              "name": "setFips",
              "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)`",
              "type": "method",
              "name": "sign",
              "meta": {
                "added": [
                  "v12.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Buffer}",
                    "name": "return",
                    "type": "Buffer"
                  },
                  "params": [
                    {
                      "textRaw": "`algorithm` {string | null | undefined}",
                      "name": "algorithm",
                      "type": "string | null | undefined"
                    },
                    {
                      "textRaw": "`data` {Buffer | TypedArray | DataView}",
                      "name": "data",
                      "type": "Buffer | TypedArray | DataView"
                    },
                    {
                      "textRaw": "`key` {Object | string | Buffer | KeyObject}",
                      "name": "key",
                      "type": "Object | string | Buffer | KeyObject"
                    }
                  ]
                }
              ],
              "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 (especially Ed25519 and Ed448).</p>\n<p>If <code>key</code> is not a <a href=\"crypto.html#crypto_class_keyobject\"><code>KeyObject</code></a>, this function behaves as if <code>key</code> had been\npassed to <a href=\"crypto.html#crypto_crypto_createprivatekey_key\"><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/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string&gt;</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/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;integer&gt;</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/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;integer&gt;</a> Salt length for when padding is\n<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>"
            },
            {
              "textRaw": "`crypto.timingSafeEqual(a, b)`",
              "type": "method",
              "name": "timingSafeEqual",
              "meta": {
                "added": [
                  "v6.6.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  },
                  "params": [
                    {
                      "textRaw": "`a` {Buffer | TypedArray | DataView}",
                      "name": "a",
                      "type": "Buffer | TypedArray | DataView"
                    },
                    {
                      "textRaw": "`b` {Buffer | TypedArray | DataView}",
                      "name": "b",
                      "type": "Buffer | TypedArray | DataView"
                    }
                  ]
                }
              ],
              "desc": "<p>This function is based on a constant-time algorithm.\nReturns true if <code>a</code> is equal to <code>b</code>, without leaking 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 length.</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)`",
              "type": "method",
              "name": "verify",
              "meta": {
                "added": [
                  "v12.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  },
                  "params": [
                    {
                      "textRaw": "`algorithm` {string | null | undefined}",
                      "name": "algorithm",
                      "type": "string | null | undefined"
                    },
                    {
                      "textRaw": "`data` {Buffer | TypedArray | DataView}",
                      "name": "data",
                      "type": "Buffer | TypedArray | DataView"
                    },
                    {
                      "textRaw": "`key` {Object | string | Buffer | KeyObject}",
                      "name": "key",
                      "type": "Object | string | Buffer | KeyObject"
                    },
                    {
                      "textRaw": "`signature` {Buffer | TypedArray | DataView}",
                      "name": "signature",
                      "type": "Buffer | TypedArray | DataView"
                    }
                  ]
                }
              ],
              "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 (especially Ed25519 and Ed448).</p>\n<p>If <code>key</code> is not a <a href=\"crypto.html#crypto_class_keyobject\"><code>KeyObject</code></a>, this function behaves as if <code>key</code> had been\npassed to <a href=\"crypto.html#crypto_crypto_createpublickey_key\"><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/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string&gt;</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/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;integer&gt;</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/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;integer&gt;</a> Salt length for when padding is\n<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>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>"
            }
          ],
          "type": "module",
          "displayName": "`crypto` module methods and properties"
        },
        {
          "textRaw": "Notes",
          "name": "notes",
          "modules": [
            {
              "textRaw": "Legacy Streams API (prior to Node.js 0.10)",
              "name": "legacy_streams_api_(prior_to_node.js_0.10)",
              "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, the many of the <code>crypto</code> defined 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 after Node.js v0.8 to use <a href=\"buffer.html\"><code>Buffer</code></a> objects by default\ninstead.</p>",
              "type": "module",
              "displayName": "Legacy Streams API (prior to Node.js 0.10)"
            },
            {
              "textRaw": "Recent ECDH changes",
              "name": "recent_ecdh_changes",
              "desc": "<p>Usage of <code>ECDH</code> with non-dynamically generated key pairs has been simplified.\nNow, <a href=\"crypto.html#crypto_ecdh_setprivatekey_privatekey_encoding\"><code>ecdh.setPrivateKey()</code></a> can be called with a preselected private key\nand the associated public point (key) will be computed and stored in the object.\nThis allows code to only store and provide the private part of the EC key pair.\n<a href=\"crypto.html#crypto_ecdh_setprivatekey_privatekey_encoding\"><code>ecdh.setPrivateKey()</code></a> now also validates that the private key is valid for\nthe selected curve.</p>\n<p>The <a href=\"crypto.html#crypto_ecdh_setpublickey_publickey_encoding\"><code>ecdh.setPublicKey()</code></a> method is now deprecated as its inclusion in the\nAPI is not useful. Either a previously stored private key should be set, which\nautomatically generates the associated public key, or <a href=\"crypto.html#crypto_ecdh_generatekeys_encoding_format\"><code>ecdh.generateKeys()</code></a>\nshould be called. The main drawback of using <a href=\"crypto.html#crypto_ecdh_setpublickey_publickey_encoding\"><code>ecdh.setPublicKey()</code></a> is that\nit can be used to put the ECDH key pair into an inconsistent state.</p>",
              "type": "module",
              "displayName": "Recent ECDH changes"
            },
            {
              "textRaw": "Support for weak or compromised algorithms",
              "name": "support_for_weak_or_compromised_algorithms",
              "desc": "<p>The <code>crypto</code> module still supports some algorithms which are already\ncompromised and are not currently 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-131Ar1.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>",
              "type": "module",
              "displayName": "Support for weak or compromised algorithms"
            },
            {
              "textRaw": "CCM mode",
              "name": "ccm_mode",
              "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> can only be called\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-js\">const crypto = require('crypto');\n\nconst key = 'keykeykeykeykeykeykeykey';\nconst nonce = crypto.randomBytes(12);\n\nconst aad = Buffer.from('0123456789', 'hex');\n\nconst cipher = crypto.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 = crypto.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  console.error('Authentication failed!');\n  return;\n}\n\nconsole.log(receivedPlaintext);\n</code></pre>",
              "type": "module",
              "displayName": "CCM mode"
            }
          ],
          "type": "module",
          "displayName": "Notes"
        },
        {
          "textRaw": "Crypto constants",
          "name": "crypto_constants",
          "desc": "<p>The following constants exported by <code>crypto.constants</code> apply to various uses of\nthe <code>crypto</code>, <code>tls</code>, and <code>https</code> modules and are generally specific to OpenSSL.</p>",
          "modules": [
            {
              "textRaw": "OpenSSL options",
              "name": "openssl_options",
              "desc": "<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/man1.0.2/ssl/SSL_CTX_set_options.html\">https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_options.html</a>\n    for detail.</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/man1.0.2/ssl/SSL_CTX_set_options.html\">https://www.openssl.org/docs/man1.0.2/ssl/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/man1.0.2/ssl/SSL_CTX_set_options.html\">https://www.openssl.org/docs/man1.0.2/ssl/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 \"speshul\" version 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 a 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_EPHEMERAL_RSA</code></td>\n    <td>Instructs OpenSSL to always use the tmp_rsa key when performing RSA\n    operations.</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_MICROSOFT_BIG_SSLV3_BUFFER</code></td>\n    <td></td>\n  </tr>\n  <tr>\n    <td><code>SSL_OP_MICROSOFT_SESS_ID_BUG</code></td>\n    <td></td>\n  </tr>\n  <tr>\n    <td><code>SSL_OP_MSIE_SSLV2_RSA_PADDING</code></td>\n    <td>Instructs OpenSSL to disable the workaround for a man-in-the-middle\n    protocol-version vulnerability in the SSL 2.0 server implementation.</td>\n  </tr>\n  <tr>\n    <td><code>SSL_OP_NETSCAPE_CA_DN_BUG</code></td>\n    <td></td>\n  </tr>\n  <tr>\n    <td><code>SSL_OP_NETSCAPE_CHALLENGE_BUG</code></td>\n    <td></td>\n  </tr>\n  <tr>\n    <td><code>SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG</code></td>\n    <td></td>\n  </tr>\n  <tr>\n    <td><code>SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG</code></td>\n    <td></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_QUERY_MTU</code></td>\n    <td></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    <td><code>SSL_OP_PKCS1_CHECK_1</code></td>\n    <td></td>\n  </tr>\n  <tr>\n    <td><code>SSL_OP_PKCS1_CHECK_2</code></td>\n    <td></td>\n  </tr>\n  <tr>\n    <td><code>SSL_OP_SINGLE_DH_USE</code></td>\n    <td>Instructs OpenSSL to always create a new key when using\n    temporary/ephemeral DH parameters.</td>\n  </tr>\n  <tr>\n    <td><code>SSL_OP_SINGLE_ECDH_USE</code></td>\n    <td>Instructs OpenSSL to always create a new key when using\n    temporary/ephemeral ECDH parameters.</td>\n  </tr>\n    <td><code>SSL_OP_SSLEAY_080_CLIENT_DH_BUG</code></td>\n    <td></td>\n  </tr>\n  <tr>\n    <td><code>SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG</code></td>\n    <td></td>\n  </tr>\n  <tr>\n    <td><code>SSL_OP_TLS_BLOCK_PADDING_BUG</code></td>\n    <td></td>\n  </tr>\n  <tr>\n    <td><code>SSL_OP_TLS_D5_BUG</code></td>\n    <td></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>",
              "type": "module",
              "displayName": "OpenSSL options"
            },
            {
              "textRaw": "OpenSSL engine constants",
              "name": "openssl_engine_constants",
              "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_METHDS</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>",
              "type": "module",
              "displayName": "OpenSSL engine constants"
            },
            {
              "textRaw": "Other OpenSSL constants",
              "name": "other_openssl_constants",
              "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>ALPN_ENABLED</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>",
              "type": "module",
              "displayName": "Other OpenSSL constants"
            },
            {
              "textRaw": "Node.js crypto constants",
              "name": "node.js_crypto_constants",
              "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>",
              "type": "module",
              "displayName": "Node.js crypto constants"
            }
          ],
          "type": "module",
          "displayName": "Crypto constants"
        }
      ],
      "classes": [
        {
          "textRaw": "Class: `Certificate`",
          "type": "class",
          "name": "Certificate",
          "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 <a href=\"https://developer.mozilla.org/en-US/docs/Web/HTML/Element/keygen\">HTML5's <code>keygen</code> element</a>.</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>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/man1.1.0/apps/openssl-spkac.html\">OpenSSL's SPKAC implementation</a> internally.</p>",
          "methods": [
            {
              "textRaw": "`Certificate.exportChallenge(spkac)`",
              "type": "method",
              "name": "exportChallenge",
              "meta": {
                "added": [
                  "v9.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "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."
                  },
                  "params": [
                    {
                      "textRaw": "`spkac` {string | Buffer | TypedArray | DataView}",
                      "name": "spkac",
                      "type": "string | Buffer | TypedArray | DataView"
                    }
                  ]
                }
              ],
              "desc": "<pre><code class=\"language-js\">const { Certificate } = require('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": "`Certificate.exportPublicKey(spkac[, encoding])`",
              "type": "method",
              "name": "exportPublicKey",
              "meta": {
                "added": [
                  "v9.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "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."
                  },
                  "params": [
                    {
                      "textRaw": "`spkac` {string | Buffer | TypedArray | DataView}",
                      "name": "spkac",
                      "type": "string | Buffer | TypedArray | DataView"
                    },
                    {
                      "textRaw": "`encoding` {string} The [encoding][] of the `spkac` string.",
                      "name": "encoding",
                      "type": "string",
                      "desc": "The [encoding][] of the `spkac` string."
                    }
                  ]
                }
              ],
              "desc": "<pre><code class=\"language-js\">const { Certificate } = require('crypto');\nconst spkac = getSpkacSomehow();\nconst publicKey = Certificate.exportPublicKey(spkac);\nconsole.log(publicKey);\n// Prints: the public key as &#x3C;Buffer ...>\n</code></pre>"
            },
            {
              "textRaw": "`Certificate.verifySpkac(spkac)`",
              "type": "method",
              "name": "verifySpkac",
              "meta": {
                "added": [
                  "v9.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "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."
                  },
                  "params": [
                    {
                      "textRaw": "`spkac` {Buffer | TypedArray | DataView}",
                      "name": "spkac",
                      "type": "Buffer | TypedArray | DataView"
                    }
                  ]
                }
              ],
              "desc": "<pre><code class=\"language-js\">const { Certificate } = require('crypto');\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",
              "desc": "<p>As a still supported legacy interface, it is possible (but not recommended) to\ncreate new instances of the <code>crypto.Certificate</code> class as illustrated in the\nexamples below.</p>",
              "ctors": [
                {
                  "textRaw": "`new crypto.Certificate()`",
                  "type": "ctor",
                  "name": "crypto.Certificate",
                  "signatures": [
                    {
                      "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-js\">const crypto = require('crypto');\n\nconst cert1 = new crypto.Certificate();\nconst cert2 = crypto.Certificate();\n</code></pre>"
                }
              ],
              "methods": [
                {
                  "textRaw": "`certificate.exportChallenge(spkac)`",
                  "type": "method",
                  "name": "exportChallenge",
                  "meta": {
                    "added": [
                      "v0.11.8"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "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."
                      },
                      "params": [
                        {
                          "textRaw": "`spkac` {string | Buffer | TypedArray | DataView}",
                          "name": "spkac",
                          "type": "string | Buffer | TypedArray | DataView"
                        }
                      ]
                    }
                  ],
                  "desc": "<pre><code class=\"language-js\">const cert = require('crypto').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)`",
                  "type": "method",
                  "name": "exportPublicKey",
                  "meta": {
                    "added": [
                      "v0.11.8"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "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."
                      },
                      "params": [
                        {
                          "textRaw": "`spkac` {string | Buffer | TypedArray | DataView}",
                          "name": "spkac",
                          "type": "string | Buffer | TypedArray | DataView"
                        }
                      ]
                    }
                  ],
                  "desc": "<pre><code class=\"language-js\">const cert = require('crypto').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)`",
                  "type": "method",
                  "name": "verifySpkac",
                  "meta": {
                    "added": [
                      "v0.11.8"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "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."
                      },
                      "params": [
                        {
                          "textRaw": "`spkac` {Buffer | TypedArray | DataView}",
                          "name": "spkac",
                          "type": "Buffer | TypedArray | DataView"
                        }
                      ]
                    }
                  ],
                  "desc": "<pre><code class=\"language-js\">const cert = require('crypto').Certificate();\nconst spkac = getSpkacSomehow();\nconsole.log(cert.verifySpkac(Buffer.from(spkac)));\n// Prints: true or false\n</code></pre>"
                }
              ],
              "type": "module",
              "displayName": "Legacy API"
            }
          ]
        },
        {
          "textRaw": "Class: `Cipher`",
          "type": "class",
          "name": "Cipher",
          "meta": {
            "added": [
              "v0.1.94"
            ],
            "changes": []
          },
          "desc": "<ul>\n<li>Extends: <a href=\"stream.html#stream_class_stream_transform\" class=\"type\">&lt;stream.Transform&gt;</a></li>\n</ul>\n<p>Instances of the <code>Cipher</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=\"crypto.html#crypto_cipher_update_data_inputencoding_outputencoding\"><code>cipher.update()</code></a> and <a href=\"crypto.html#crypto_cipher_final_outputencoding\"><code>cipher.final()</code></a> methods to produce\nthe encrypted data.</li>\n</ul>\n<p>The <a href=\"crypto.html#crypto_crypto_createcipher_algorithm_password_options\"><code>crypto.createCipher()</code></a> or <a href=\"crypto.html#crypto_crypto_createcipheriv_algorithm_key_iv_options\"><code>crypto.createCipheriv()</code></a> methods are\nused to create <code>Cipher</code> instances. <code>Cipher</code> objects are not to be created\ndirectly using the <code>new</code> keyword.</p>\n<p>Example: Using <code>Cipher</code> objects as streams:</p>\n<pre><code class=\"language-js\">const crypto = require('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 async `crypto.scrypt()` instead.\nconst key = crypto.scryptSync(password, 'salt', 24);\n// Use `crypto.randomBytes()` to generate a random iv instead of the static iv\n// shown here.\nconst iv = Buffer.alloc(16, 0); // Initialization vector.\n\nconst cipher = crypto.createCipheriv(algorithm, key, iv);\n\nlet encrypted = '';\ncipher.on('readable', () => {\n  let chunk;\n  while (null !== (chunk = cipher.read())) {\n    encrypted += chunk.toString('hex');\n  }\n});\ncipher.on('end', () => {\n  console.log(encrypted);\n  // Prints: e5f79c5915c02171eec6b212d5520d44480993d7d622a7c4c2da32f6efda0ffa\n});\n\ncipher.write('some clear text data');\ncipher.end();\n</code></pre>\n<p>Example: Using <code>Cipher</code> and piped streams:</p>\n<pre><code class=\"language-js\">const crypto = require('crypto');\nconst fs = require('fs');\n\nconst algorithm = 'aes-192-cbc';\nconst password = 'Password used to generate key';\n// Use the async `crypto.scrypt()` instead.\nconst key = crypto.scryptSync(password, 'salt', 24);\n// Use `crypto.randomBytes()` to generate a random iv instead of the static iv\n// shown here.\nconst iv = Buffer.alloc(16, 0); // Initialization vector.\n\nconst cipher = crypto.createCipheriv(algorithm, key, iv);\n\nconst input = fs.createReadStream('test.js');\nconst output = fs.createWriteStream('test.enc');\n\ninput.pipe(cipher).pipe(output);\n</code></pre>\n<p>Example: Using the <a href=\"crypto.html#crypto_cipher_update_data_inputencoding_outputencoding\"><code>cipher.update()</code></a> and <a href=\"crypto.html#crypto_cipher_final_outputencoding\"><code>cipher.final()</code></a> methods:</p>\n<pre><code class=\"language-js\">const crypto = require('crypto');\n\nconst algorithm = 'aes-192-cbc';\nconst password = 'Password used to generate key';\n// Use the async `crypto.scrypt()` instead.\nconst key = crypto.scryptSync(password, 'salt', 24);\n// Use `crypto.randomBytes` to generate a random iv instead of the static iv\n// shown here.\nconst iv = Buffer.alloc(16, 0); // Initialization vector.\n\nconst cipher = crypto.createCipheriv(algorithm, key, iv);\n\nlet encrypted = cipher.update('some clear text data', 'utf8', 'hex');\nencrypted += cipher.final('hex');\nconsole.log(encrypted);\n// Prints: e5f79c5915c02171eec6b212d5520d44480993d7d622a7c4c2da32f6efda0ffa\n</code></pre>",
          "methods": [
            {
              "textRaw": "`cipher.final([outputEncoding])`",
              "type": "method",
              "name": "final",
              "meta": {
                "added": [
                  "v0.1.94"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "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."
                  },
                  "params": [
                    {
                      "textRaw": "`outputEncoding` {string} The [encoding][] of the return value.",
                      "name": "outputEncoding",
                      "type": "string",
                      "desc": "The [encoding][] of the return value."
                    }
                  ]
                }
              ],
              "desc": "<p>Once the <code>cipher.final()</code> method has been called, the <code>Cipher</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.setAAD(buffer[, options])`",
              "type": "method",
              "name": "setAAD",
              "meta": {
                "added": [
                  "v1.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Cipher} for method chaining.",
                    "name": "return",
                    "type": "Cipher",
                    "desc": "for method chaining."
                  },
                  "params": [
                    {
                      "textRaw": "`buffer` {Buffer | TypedArray | DataView}",
                      "name": "buffer",
                      "type": "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"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>When using an authenticated encryption mode (<code>GCM</code>, <code>CCM</code> and <code>OCB</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>options</code> argument is optional for <code>GCM</code> and <code>OCB</code>. When using <code>CCM</code>, the\n<code>plaintextLength</code> option must be specified and its value must match the length\nof the plaintext in bytes. See <a href=\"crypto.html#crypto_ccm_mode\">CCM mode</a>.</p>\n<p>The <code>cipher.setAAD()</code> method must be called before <a href=\"crypto.html#crypto_cipher_update_data_inputencoding_outputencoding\"><code>cipher.update()</code></a>.</p>"
            },
            {
              "textRaw": "`cipher.getAuthTag()`",
              "type": "method",
              "name": "getAuthTag",
              "meta": {
                "added": [
                  "v1.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Buffer} When using an authenticated encryption mode (`GCM`, `CCM` and `OCB` 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` and `OCB` are currently supported), the `cipher.getAuthTag()` method returns a [`Buffer`][] containing the _authentication tag_ that has been computed from the given data."
                  },
                  "params": []
                }
              ],
              "desc": "<p>The <code>cipher.getAuthTag()</code> method should only be called after encryption has\nbeen completed using the <a href=\"crypto.html#crypto_cipher_final_outputencoding\"><code>cipher.final()</code></a> method.</p>"
            },
            {
              "textRaw": "`cipher.setAutoPadding([autoPadding])`",
              "type": "method",
              "name": "setAutoPadding",
              "meta": {
                "added": [
                  "v0.7.1"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Cipher} for method chaining.",
                    "name": "return",
                    "type": "Cipher",
                    "desc": "for method chaining."
                  },
                  "params": [
                    {
                      "textRaw": "`autoPadding` {boolean} **Default:** `true`",
                      "name": "autoPadding",
                      "type": "boolean",
                      "default": "`true`"
                    }
                  ]
                }
              ],
              "desc": "<p>When using block encryption algorithms, the <code>Cipher</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=\"crypto.html#crypto_cipher_final_outputencoding\"><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=\"crypto.html#crypto_cipher_final_outputencoding\"><code>cipher.final()</code></a>.</p>"
            },
            {
              "textRaw": "`cipher.update(data[, inputEncoding][, outputEncoding])`",
              "type": "method",
              "name": "update",
              "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": [
                {
                  "return": {
                    "textRaw": "Returns: {Buffer | string}",
                    "name": "return",
                    "type": "Buffer | string"
                  },
                  "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."
                    },
                    {
                      "textRaw": "`outputEncoding` {string} The [encoding][] of the return value.",
                      "name": "outputEncoding",
                      "type": "string",
                      "desc": "The [encoding][] of the return value."
                    }
                  ]
                }
              ],
              "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=\"crypto.html#crypto_cipher_final_outputencoding\"><code>cipher.final()</code></a> is called. Calling <code>cipher.update()</code> after\n<a href=\"crypto.html#crypto_cipher_final_outputencoding\"><code>cipher.final()</code></a> will result in an error being thrown.</p>"
            }
          ]
        },
        {
          "textRaw": "Class: `Decipher`",
          "type": "class",
          "name": "Decipher",
          "meta": {
            "added": [
              "v0.1.94"
            ],
            "changes": []
          },
          "desc": "<ul>\n<li>Extends: <a href=\"stream.html#stream_class_stream_transform\" class=\"type\">&lt;stream.Transform&gt;</a></li>\n</ul>\n<p>Instances of the <code>Decipher</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=\"crypto.html#crypto_decipher_update_data_inputencoding_outputencoding\"><code>decipher.update()</code></a> and <a href=\"crypto.html#crypto_decipher_final_outputencoding\"><code>decipher.final()</code></a> methods to\nproduce the unencrypted data.</li>\n</ul>\n<p>The <a href=\"crypto.html#crypto_crypto_createdecipher_algorithm_password_options\"><code>crypto.createDecipher()</code></a> or <a href=\"crypto.html#crypto_crypto_createdecipheriv_algorithm_key_iv_options\"><code>crypto.createDecipheriv()</code></a> methods are\nused to create <code>Decipher</code> instances. <code>Decipher</code> objects are not to be created\ndirectly using the <code>new</code> keyword.</p>\n<p>Example: Using <code>Decipher</code> objects as streams:</p>\n<pre><code class=\"language-js\">const crypto = require('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 = crypto.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 = crypto.createDecipheriv(algorithm, key, iv);\n\nlet decrypted = '';\ndecipher.on('readable', () => {\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>Decipher</code> and piped streams:</p>\n<pre><code class=\"language-js\">const crypto = require('crypto');\nconst fs = require('fs');\n\nconst algorithm = 'aes-192-cbc';\nconst password = 'Password used to generate key';\n// Use the async `crypto.scrypt()` instead.\nconst key = crypto.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 = crypto.createDecipheriv(algorithm, key, iv);\n\nconst input = fs.createReadStream('test.enc');\nconst output = fs.createWriteStream('test.js');\n\ninput.pipe(decipher).pipe(output);\n</code></pre>\n<p>Example: Using the <a href=\"crypto.html#crypto_decipher_update_data_inputencoding_outputencoding\"><code>decipher.update()</code></a> and <a href=\"crypto.html#crypto_decipher_final_outputencoding\"><code>decipher.final()</code></a> methods:</p>\n<pre><code class=\"language-js\">const crypto = require('crypto');\n\nconst algorithm = 'aes-192-cbc';\nconst password = 'Password used to generate key';\n// Use the async `crypto.scrypt()` instead.\nconst key = crypto.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 = crypto.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])`",
              "type": "method",
              "name": "final",
              "meta": {
                "added": [
                  "v0.1.94"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "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."
                  },
                  "params": [
                    {
                      "textRaw": "`outputEncoding` {string} The [encoding][] of the return value.",
                      "name": "outputEncoding",
                      "type": "string",
                      "desc": "The [encoding][] of the return value."
                    }
                  ]
                }
              ],
              "desc": "<p>Once the <code>decipher.final()</code> method has been called, the <code>Decipher</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])`",
              "type": "method",
              "name": "setAAD",
              "meta": {
                "added": [
                  "v1.0.0"
                ],
                "changes": [
                  {
                    "version": "v7.2.0",
                    "pr-url": "https://github.com/nodejs/node/pull/9398",
                    "description": "This method now returns a reference to `decipher`."
                  }
                ]
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Decipher} for method chaining.",
                    "name": "return",
                    "type": "Decipher",
                    "desc": "for method chaining."
                  },
                  "params": [
                    {
                      "textRaw": "`buffer` {Buffer | TypedArray | DataView}",
                      "name": "buffer",
                      "type": "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"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>When using an authenticated encryption mode (<code>GCM</code>, <code>CCM</code> and <code>OCB</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=\"crypto.html#crypto_ccm_mode\">CCM mode</a>.</p>\n<p>The <code>decipher.setAAD()</code> method must be called before <a href=\"crypto.html#crypto_decipher_update_data_inputencoding_outputencoding\"><code>decipher.update()</code></a>.</p>"
            },
            {
              "textRaw": "`decipher.setAuthTag(buffer)`",
              "type": "method",
              "name": "setAuthTag",
              "meta": {
                "added": [
                  "v1.0.0"
                ],
                "changes": [
                  {
                    "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": [
                {
                  "return": {
                    "textRaw": "Returns: {Decipher} for method chaining.",
                    "name": "return",
                    "type": "Decipher",
                    "desc": "for method chaining."
                  },
                  "params": [
                    {
                      "textRaw": "`buffer` {Buffer | TypedArray | DataView}",
                      "name": "buffer",
                      "type": "Buffer | TypedArray | DataView"
                    }
                  ]
                }
              ],
              "desc": "<p>When using an authenticated encryption mode (<code>GCM</code>, <code>CCM</code> and <code>OCB</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=\"crypto.html#crypto_decipher_final_outputencoding\"><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=\"crypto.html#crypto_decipher_update_data_inputencoding_outputencoding\"><code>decipher.update()</code></a>\nfor <code>CCM</code> mode or before <a href=\"crypto.html#crypto_decipher_final_outputencoding\"><code>decipher.final()</code></a> for <code>GCM</code> and <code>OCB</code> modes.\n<code>decipher.setAuthTag()</code> can only be called once.</p>"
            },
            {
              "textRaw": "`decipher.setAutoPadding([autoPadding])`",
              "type": "method",
              "name": "setAutoPadding",
              "meta": {
                "added": [
                  "v0.7.1"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Decipher} for method chaining.",
                    "name": "return",
                    "type": "Decipher",
                    "desc": "for method chaining."
                  },
                  "params": [
                    {
                      "textRaw": "`autoPadding` {boolean} **Default:** `true`",
                      "name": "autoPadding",
                      "type": "boolean",
                      "default": "`true`"
                    }
                  ]
                }
              ],
              "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=\"crypto.html#crypto_decipher_final_outputencoding\"><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=\"crypto.html#crypto_decipher_final_outputencoding\"><code>decipher.final()</code></a>.</p>"
            },
            {
              "textRaw": "`decipher.update(data[, inputEncoding][, outputEncoding])`",
              "type": "method",
              "name": "update",
              "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": [
                {
                  "return": {
                    "textRaw": "Returns: {Buffer | string}",
                    "name": "return",
                    "type": "Buffer | string"
                  },
                  "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."
                    },
                    {
                      "textRaw": "`outputEncoding` {string} The [encoding][] of the return value.",
                      "name": "outputEncoding",
                      "type": "string",
                      "desc": "The [encoding][] of the return value."
                    }
                  ]
                }
              ],
              "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=\"crypto.html#crypto_decipher_final_outputencoding\"><code>decipher.final()</code></a> is called. Calling <code>decipher.update()</code> after\n<a href=\"crypto.html#crypto_decipher_final_outputencoding\"><code>decipher.final()</code></a> will result in an error being thrown.</p>"
            }
          ]
        },
        {
          "textRaw": "Class: `DiffieHellman`",
          "type": "class",
          "name": "DiffieHellman",
          "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=\"crypto.html#crypto_crypto_creatediffiehellman_prime_primeencoding_generator_generatorencoding\"><code>crypto.createDiffieHellman()</code></a> function.</p>\n<pre><code class=\"language-js\">const crypto = require('crypto');\nconst assert = require('assert');\n\n// Generate Alice's keys...\nconst alice = crypto.createDiffieHellman(2048);\nconst aliceKey = alice.generateKeys();\n\n// Generate Bob's keys...\nconst bob = crypto.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])`",
              "type": "method",
              "name": "computeSecret",
              "meta": {
                "added": [
                  "v0.5.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Buffer | string}",
                    "name": "return",
                    "type": "Buffer | string"
                  },
                  "params": [
                    {
                      "textRaw": "`otherPublicKey` {string | Buffer | TypedArray | DataView}",
                      "name": "otherPublicKey",
                      "type": "string | Buffer | TypedArray | DataView"
                    },
                    {
                      "textRaw": "`inputEncoding` {string} The [encoding][] of an `otherPublicKey` string.",
                      "name": "inputEncoding",
                      "type": "string",
                      "desc": "The [encoding][] of an `otherPublicKey` string."
                    },
                    {
                      "textRaw": "`outputEncoding` {string} The [encoding][] of the return value.",
                      "name": "outputEncoding",
                      "type": "string",
                      "desc": "The [encoding][] of the return value."
                    }
                  ]
                }
              ],
              "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])`",
              "type": "method",
              "name": "generateKeys",
              "meta": {
                "added": [
                  "v0.5.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Buffer | string}",
                    "name": "return",
                    "type": "Buffer | string"
                  },
                  "params": [
                    {
                      "textRaw": "`encoding` {string} The [encoding][] of the return value.",
                      "name": "encoding",
                      "type": "string",
                      "desc": "The [encoding][] of the return value."
                    }
                  ]
                }
              ],
              "desc": "<p>Generates private and public Diffie-Hellman key values, 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>"
            },
            {
              "textRaw": "`diffieHellman.getGenerator([encoding])`",
              "type": "method",
              "name": "getGenerator",
              "meta": {
                "added": [
                  "v0.5.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Buffer | string}",
                    "name": "return",
                    "type": "Buffer | string"
                  },
                  "params": [
                    {
                      "textRaw": "`encoding` {string} The [encoding][] of the return value.",
                      "name": "encoding",
                      "type": "string",
                      "desc": "The [encoding][] of the return value."
                    }
                  ]
                }
              ],
              "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])`",
              "type": "method",
              "name": "getPrime",
              "meta": {
                "added": [
                  "v0.5.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Buffer | string}",
                    "name": "return",
                    "type": "Buffer | string"
                  },
                  "params": [
                    {
                      "textRaw": "`encoding` {string} The [encoding][] of the return value.",
                      "name": "encoding",
                      "type": "string",
                      "desc": "The [encoding][] of the return value."
                    }
                  ]
                }
              ],
              "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])`",
              "type": "method",
              "name": "getPrivateKey",
              "meta": {
                "added": [
                  "v0.5.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Buffer | string}",
                    "name": "return",
                    "type": "Buffer | string"
                  },
                  "params": [
                    {
                      "textRaw": "`encoding` {string} The [encoding][] of the return value.",
                      "name": "encoding",
                      "type": "string",
                      "desc": "The [encoding][] of the return value."
                    }
                  ]
                }
              ],
              "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])`",
              "type": "method",
              "name": "getPublicKey",
              "meta": {
                "added": [
                  "v0.5.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Buffer | string}",
                    "name": "return",
                    "type": "Buffer | string"
                  },
                  "params": [
                    {
                      "textRaw": "`encoding` {string} The [encoding][] of the return value.",
                      "name": "encoding",
                      "type": "string",
                      "desc": "The [encoding][] of the return value."
                    }
                  ]
                }
              ],
              "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])`",
              "type": "method",
              "name": "setPrivateKey",
              "meta": {
                "added": [
                  "v0.5.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`privateKey` {string | Buffer | TypedArray | DataView}",
                      "name": "privateKey",
                      "type": "string | Buffer | TypedArray | DataView"
                    },
                    {
                      "textRaw": "`encoding` {string} The [encoding][] of the `privateKey` string.",
                      "name": "encoding",
                      "type": "string",
                      "desc": "The [encoding][] of the `privateKey` string."
                    }
                  ]
                }
              ],
              "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>"
            },
            {
              "textRaw": "`diffieHellman.setPublicKey(publicKey[, encoding])`",
              "type": "method",
              "name": "setPublicKey",
              "meta": {
                "added": [
                  "v0.5.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`publicKey` {string | Buffer | TypedArray | DataView}",
                      "name": "publicKey",
                      "type": "string | Buffer | TypedArray | DataView"
                    },
                    {
                      "textRaw": "`encoding` {string} The [encoding][] of the `publicKey` string.",
                      "name": "encoding",
                      "type": "string",
                      "desc": "The [encoding][] of the `publicKey` string."
                    }
                  ]
                }
              ],
              "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",
              "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>constants</code>\nmodule):</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`",
          "type": "class",
          "name": "DiffieHellmanGroup",
          "meta": {
            "added": [
              "v0.7.5"
            ],
            "changes": []
          },
          "desc": "<p>The <code>DiffieHellmanGroup</code> class takes a well-known modp group as its argument but\notherwise works the same as <code>DiffieHellman</code>.</p>\n<pre><code class=\"language-js\">const name = 'modp1';\nconst dh = crypto.createDiffieHellmanGroup(name);\n</code></pre>\n<p><code>name</code> is taken from <a href=\"https://www.rfc-editor.org/rfc/rfc2412.txt\">RFC 2412</a> (modp1 and 2) and <a href=\"https://www.rfc-editor.org/rfc/rfc3526.txt\">RFC 3526</a>:</p>\n<pre><code class=\"language-console\">$ perl -ne 'print \"$1\\n\" if /\"(modp\\d+)\"/' src/node_crypto_groups.h\nmodp1  #  768 bits\nmodp2  # 1024 bits\nmodp5  # 1536 bits\nmodp14 # 2048 bits\nmodp15 # etc.\nmodp16\nmodp17\nmodp18\n</code></pre>"
        },
        {
          "textRaw": "Class: `ECDH`",
          "type": "class",
          "name": "ECDH",
          "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=\"crypto.html#crypto_crypto_createecdh_curvename\"><code>crypto.createECDH()</code></a> function.</p>\n<pre><code class=\"language-js\">const crypto = require('crypto');\nconst assert = require('assert');\n\n// Generate Alice's keys...\nconst alice = crypto.createECDH('secp521r1');\nconst aliceKey = alice.generateKeys();\n\n// Generate Bob's keys...\nconst bob = crypto.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": "Class Method: `ECDH.convertKey(key, curve[, inputEncoding[, outputEncoding[, format]]])`",
              "type": "classMethod",
              "name": "convertKey",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Buffer | string}",
                    "name": "return",
                    "type": "Buffer | string"
                  },
                  "params": [
                    {
                      "textRaw": "`key` {string | Buffer | TypedArray | DataView}",
                      "name": "key",
                      "type": "string | 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."
                    },
                    {
                      "textRaw": "`outputEncoding` {string} The [encoding][] of the return value.",
                      "name": "outputEncoding",
                      "type": "string",
                      "desc": "The [encoding][] of the return value."
                    },
                    {
                      "textRaw": "`format` {string} **Default:** `'uncompressed'`",
                      "name": "format",
                      "type": "string",
                      "default": "`'uncompressed'`"
                    }
                  ]
                }
              ],
              "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=\"crypto.html#crypto_crypto_getcurves\"><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-js\">const { createECDH, ECDH } = require('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])`",
              "type": "method",
              "name": "computeSecret",
              "meta": {
                "added": [
                  "v0.11.14"
                ],
                "changes": [
                  {
                    "version": "v6.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/5522",
                    "description": "The default `inputEncoding` changed from `binary` to `utf8`"
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/16849",
                    "description": "Changed error format to better support invalid public key error"
                  }
                ]
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Buffer | string}",
                    "name": "return",
                    "type": "Buffer | string"
                  },
                  "params": [
                    {
                      "textRaw": "`otherPublicKey` {string | Buffer | TypedArray | DataView}",
                      "name": "otherPublicKey",
                      "type": "string | Buffer | TypedArray | DataView"
                    },
                    {
                      "textRaw": "`inputEncoding` {string} The [encoding][] of the `otherPublicKey` string.",
                      "name": "inputEncoding",
                      "type": "string",
                      "desc": "The [encoding][] of the `otherPublicKey` string."
                    },
                    {
                      "textRaw": "`outputEncoding` {string} The [encoding][] of the return value.",
                      "name": "outputEncoding",
                      "type": "string",
                      "desc": "The [encoding][] of the return value."
                    }
                  ]
                }
              ],
              "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,\nits recommended for developers to handle this exception accordingly.</p>"
            },
            {
              "textRaw": "`ecdh.generateKeys([encoding[, format]])`",
              "type": "method",
              "name": "generateKeys",
              "meta": {
                "added": [
                  "v0.11.14"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Buffer | string}",
                    "name": "return",
                    "type": "Buffer | string"
                  },
                  "params": [
                    {
                      "textRaw": "`encoding` {string} The [encoding][] of the return value.",
                      "name": "encoding",
                      "type": "string",
                      "desc": "The [encoding][] of the return value."
                    },
                    {
                      "textRaw": "`format` {string} **Default:** `'uncompressed'`",
                      "name": "format",
                      "type": "string",
                      "default": "`'uncompressed'`"
                    }
                  ]
                }
              ],
              "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])`",
              "type": "method",
              "name": "getPrivateKey",
              "meta": {
                "added": [
                  "v0.11.14"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "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`."
                  },
                  "params": [
                    {
                      "textRaw": "`encoding` {string} The [encoding][] of the return value.",
                      "name": "encoding",
                      "type": "string",
                      "desc": "The [encoding][] of the return value."
                    }
                  ]
                }
              ],
              "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])`",
              "type": "method",
              "name": "getPublicKey",
              "meta": {
                "added": [
                  "v0.11.14"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "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`."
                  },
                  "params": [
                    {
                      "textRaw": "`encoding` {string} The [encoding][] of the return value.",
                      "name": "encoding",
                      "type": "string",
                      "desc": "The [encoding][] of the return value."
                    },
                    {
                      "textRaw": "`format` {string} **Default:** `'uncompressed'`",
                      "name": "format",
                      "type": "string",
                      "default": "`'uncompressed'`"
                    }
                  ]
                }
              ],
              "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])`",
              "type": "method",
              "name": "setPrivateKey",
              "meta": {
                "added": [
                  "v0.11.14"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`privateKey` {string | Buffer | TypedArray | DataView}",
                      "name": "privateKey",
                      "type": "string | Buffer | TypedArray | DataView"
                    },
                    {
                      "textRaw": "`encoding` {string} The [encoding][] of the `privateKey` string.",
                      "name": "encoding",
                      "type": "string",
                      "desc": "The [encoding][] of the `privateKey` string."
                    }
                  ]
                }
              ],
              "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])`",
              "type": "method",
              "name": "setPublicKey",
              "meta": {
                "added": [
                  "v0.11.14"
                ],
                "deprecated": [
                  "v5.2.0"
                ],
                "changes": []
              },
              "stability": 0,
              "stabilityText": "Deprecated",
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`publicKey` {string | Buffer | TypedArray | DataView}",
                      "name": "publicKey",
                      "type": "string | Buffer | TypedArray | DataView"
                    },
                    {
                      "textRaw": "`encoding` {string} The [encoding][] of the `publicKey` string.",
                      "name": "encoding",
                      "type": "string",
                      "desc": "The [encoding][] of the `publicKey` string."
                    }
                  ]
                }
              ],
              "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=\"crypto.html#crypto_ecdh_generatekeys_encoding_format\"><code>ecdh.generateKeys()</code></a> or\n<a href=\"crypto.html#crypto_ecdh_setprivatekey_privatekey_encoding\"><code>ecdh.setPrivateKey()</code></a> will be called. The <a href=\"crypto.html#crypto_ecdh_setprivatekey_privatekey_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-js\">const crypto = require('crypto');\nconst alice = crypto.createECDH('secp256k1');\nconst bob = crypto.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  crypto.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`",
          "type": "class",
          "name": "Hash",
          "meta": {
            "added": [
              "v0.1.92"
            ],
            "changes": []
          },
          "desc": "<ul>\n<li>Extends: <a href=\"stream.html#stream_class_stream_transform\" class=\"type\">&lt;stream.Transform&gt;</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=\"crypto.html#crypto_hash_update_data_inputencoding\"><code>hash.update()</code></a> and <a href=\"crypto.html#crypto_hash_digest_encoding\"><code>hash.digest()</code></a> methods to produce the\ncomputed hash.</li>\n</ul>\n<p>The <a href=\"crypto.html#crypto_crypto_createhash_algorithm_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-js\">const crypto = require('crypto');\nconst hash = crypto.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-js\">const crypto = require('crypto');\nconst fs = require('fs');\nconst hash = crypto.createHash('sha256');\n\nconst input = fs.createReadStream('test.js');\ninput.pipe(hash).pipe(process.stdout);\n</code></pre>\n<p>Example: Using the <a href=\"crypto.html#crypto_hash_update_data_inputencoding\"><code>hash.update()</code></a> and <a href=\"crypto.html#crypto_hash_digest_encoding\"><code>hash.digest()</code></a> methods:</p>\n<pre><code class=\"language-js\">const crypto = require('crypto');\nconst hash = crypto.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])`",
              "type": "method",
              "name": "copy",
              "meta": {
                "added": [
                  "v12.16.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Hash}",
                    "name": "return",
                    "type": "Hash"
                  },
                  "params": [
                    {
                      "textRaw": "`options` {Object} [`stream.transform` options][]",
                      "name": "options",
                      "type": "Object",
                      "desc": "[`stream.transform` options][]"
                    }
                  ]
                }
              ],
              "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=\"crypto.html#crypto_hash_digest_encoding\"><code>hash.digest()</code></a> method has been called.</p>\n<pre><code class=\"language-js\">// Calculate a rolling hash.\nconst crypto = require('crypto');\nconst hash = crypto.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])`",
              "type": "method",
              "name": "digest",
              "meta": {
                "added": [
                  "v0.1.92"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Buffer | string}",
                    "name": "return",
                    "type": "Buffer | string"
                  },
                  "params": [
                    {
                      "textRaw": "`encoding` {string} The [encoding][] of the return value.",
                      "name": "encoding",
                      "type": "string",
                      "desc": "The [encoding][] of the return value."
                    }
                  ]
                }
              ],
              "desc": "<p>Calculates the digest of all of the data passed to be hashed (using the\n<a href=\"crypto.html#crypto_hash_update_data_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])`",
              "type": "method",
              "name": "update",
              "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."
                    }
                  ]
                }
              ],
              "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`",
          "type": "class",
          "name": "Hmac",
          "meta": {
            "added": [
              "v0.1.94"
            ],
            "changes": []
          },
          "desc": "<ul>\n<li>Extends: <a href=\"stream.html#stream_class_stream_transform\" class=\"type\">&lt;stream.Transform&gt;</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=\"crypto.html#crypto_hmac_update_data_inputencoding\"><code>hmac.update()</code></a> and <a href=\"crypto.html#crypto_hmac_digest_encoding\"><code>hmac.digest()</code></a> methods to produce the\ncomputed HMAC digest.</li>\n</ul>\n<p>The <a href=\"crypto.html#crypto_crypto_createhmac_algorithm_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-js\">const crypto = require('crypto');\nconst hmac = crypto.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-js\">const crypto = require('crypto');\nconst fs = require('fs');\nconst hmac = crypto.createHmac('sha256', 'a secret');\n\nconst input = fs.createReadStream('test.js');\ninput.pipe(hmac).pipe(process.stdout);\n</code></pre>\n<p>Example: Using the <a href=\"crypto.html#crypto_hmac_update_data_inputencoding\"><code>hmac.update()</code></a> and <a href=\"crypto.html#crypto_hmac_digest_encoding\"><code>hmac.digest()</code></a> methods:</p>\n<pre><code class=\"language-js\">const crypto = require('crypto');\nconst hmac = crypto.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])`",
              "type": "method",
              "name": "digest",
              "meta": {
                "added": [
                  "v0.1.94"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Buffer | string}",
                    "name": "return",
                    "type": "Buffer | string"
                  },
                  "params": [
                    {
                      "textRaw": "`encoding` {string} The [encoding][] of the return value.",
                      "name": "encoding",
                      "type": "string",
                      "desc": "The [encoding][] of the return value."
                    }
                  ]
                }
              ],
              "desc": "<p>Calculates the HMAC digest of all of the data passed using <a href=\"crypto.html#crypto_hmac_update_data_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])`",
              "type": "method",
              "name": "update",
              "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."
                    }
                  ]
                }
              ],
              "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`",
          "type": "class",
          "name": "KeyObject",
          "meta": {
            "added": [
              "v11.6.0"
            ],
            "changes": [
              {
                "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=\"crypto.html#crypto_crypto_createsecretkey_key\"><code>crypto.createSecretKey()</code></a>, <a href=\"crypto.html#crypto_crypto_createpublickey_key\"><code>crypto.createPublicKey()</code></a> and\n<a href=\"crypto.html#crypto_crypto_createprivatekey_key\"><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>",
          "properties": [
            {
              "textRaw": "`asymmetricKeyType` {string}",
              "type": "string",
              "name": "asymmetricKeyType",
              "meta": {
                "added": [
                  "v11.6.0"
                ],
                "changes": [
                  {
                    "version": "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. Supported key\ntypes are:</p>\n<ul>\n<li><code>'rsa'</code> (OID 1.2.840.113549.1.1.1)</li>\n<li><code>'rsa-pss'</code> (OID 1.2.840.113549.1.1.10)</li>\n<li><code>'dsa'</code> (OID 1.2.840.10040.4.1)</li>\n<li><code>'ec'</code> (OID 1.2.840.10045.2.1)</li>\n<li><code>'x25519'</code> (OID 1.3.101.110)</li>\n<li><code>'x448'</code> (OID 1.3.101.111)</li>\n<li><code>'ed25519'</code> (OID 1.3.101.112)</li>\n<li><code>'ed448'</code> (OID 1.3.101.113)</li>\n<li><code>'dh'</code> (OID 1.2.840.113549.1.3.1)</li>\n</ul>\n<p>This property is <code>undefined</code> for unrecognized <code>KeyObject</code> types and symmetric\nkeys.</p>"
            },
            {
              "textRaw": "`symmetricKeySize` {number}",
              "type": "number",
              "name": "symmetricKeySize",
              "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}",
              "type": "string",
              "name": "type",
              "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.export([options])`",
              "type": "method",
              "name": "export",
              "meta": {
                "added": [
                  "v11.6.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {string | Buffer}",
                    "name": "return",
                    "type": "string | Buffer"
                  },
                  "params": [
                    {
                      "textRaw": "`options`: {Object}",
                      "name": "options",
                      "type": "Object"
                    }
                  ]
                }
              ],
              "desc": "<p>For symmetric keys, this function allocates a <code>Buffer</code> containing the key\nmaterial and ignores any options.</p>\n<p>For asymmetric keys, the <code>options</code> parameter is used to determine the export\nformat.</p>\n<p>For public keys, the following encoding options can be used:</p>\n<ul>\n<li><code>type</code>: <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string&gt;</a> Must be one of <code>'pkcs1'</code> (RSA only) or <code>'spki'</code>.</li>\n<li><code>format</code>: <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string&gt;</a> Must be <code>'pem'</code> or <code>'der'</code>.</li>\n</ul>\n<p>For private keys, the following encoding options can be used:</p>\n<ul>\n<li><code>type</code>: <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string&gt;</a> Must be one of <code>'pkcs1'</code> (RSA only), <code>'pkcs8'</code> or\n<code>'sec1'</code> (EC only).</li>\n<li><code>format</code>: <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string&gt;</a> Must be <code>'pem'</code> or <code>'der'</code>.</li>\n<li><code>cipher</code>: <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string&gt;</a> If specified, the private key will be encrypted with\n the given <code>cipher</code> and <code>passphrase</code> using PKCS#5 v2.0 password based\nencryption.</li>\n<li><code>passphrase</code>: <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string&gt;</a> | <a href=\"buffer.html#buffer_class_buffer\" class=\"type\">&lt;Buffer&gt;</a> The passphrase to use for encryption, see\n<code>cipher</code>.</li>\n</ul>\n<p>When PEM encoding was selected, the result will be a string, otherwise it will\nbe a buffer containing the data encoded as DER.</p>\n<p>PKCS#1, SEC1, and PKCS#8 type keys can be encrypted by using a combination of\nthe <code>cipher</code> and <code>format</code> options. The PKCS#8 <code>type</code> can be used with any\n<code>format</code> to encrypt any key algorithm (RSA, EC, or DH) by specifying a\n<code>cipher</code>. PKCS#1 and SEC1 can only be encrypted by specifying a <code>cipher</code>\nwhen the PEM <code>format</code> is used. For maximum compatibility, use PKCS#8 for\nencrypted private keys. Since PKCS#8 defines its own\nencryption mechanism, PEM-level encryption is not supported when encrypting\na PKCS#8 key. See <a href=\"https://www.rfc-editor.org/rfc/rfc5208.txt\">RFC 5208</a> for PKCS#8 encryption and <a href=\"https://www.rfc-editor.org/rfc/rfc1421.txt\">RFC 1421</a> for\nPKCS#1 and SEC1 encryption.</p>"
            }
          ]
        },
        {
          "textRaw": "Class: `Sign`",
          "type": "class",
          "name": "Sign",
          "meta": {
            "added": [
              "v0.1.92"
            ],
            "changes": []
          },
          "desc": "<ul>\n<li>Extends: <a href=\"stream.html#stream_class_stream_writable\" class=\"type\">&lt;stream.Writable&gt;</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=\"crypto.html#crypto_sign_sign_privatekey_outputencoding\"><code>sign.sign()</code></a> method is used to generate and return the signature, or</li>\n<li>Using the <a href=\"crypto.html#crypto_sign_update_data_inputencoding\"><code>sign.update()</code></a> and <a href=\"crypto.html#crypto_sign_sign_privatekey_outputencoding\"><code>sign.sign()</code></a> methods to produce the\nsignature.</li>\n</ul>\n<p>The <a href=\"crypto.html#crypto_crypto_createsign_algorithm_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=\"crypto.html#crypto_class_verify\"><code>Verify</code></a> objects as streams:</p>\n<pre><code class=\"language-js\">const crypto = require('crypto');\n\nconst { privateKey, publicKey } = crypto.generateKeyPairSync('ec', {\n  namedCurve: 'sect239k1'\n});\n\nconst sign = crypto.createSign('SHA256');\nsign.write('some data to sign');\nsign.end();\nconst signature = sign.sign(privateKey, 'hex');\n\nconst verify = crypto.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=\"crypto.html#crypto_sign_update_data_inputencoding\"><code>sign.update()</code></a> and <a href=\"crypto.html#crypto_verify_update_data_inputencoding\"><code>verify.update()</code></a> methods:</p>\n<pre><code class=\"language-js\">const crypto = require('crypto');\n\nconst { privateKey, publicKey } = crypto.generateKeyPairSync('rsa', {\n  modulusLength: 2048,\n});\n\nconst sign = crypto.createSign('SHA256');\nsign.update('some data to sign');\nsign.end();\nconst signature = sign.sign(privateKey);\n\nconst verify = crypto.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])`",
              "type": "method",
              "name": "sign",
              "meta": {
                "added": [
                  "v0.1.92"
                ],
                "changes": [
                  {
                    "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": [
                {
                  "return": {
                    "textRaw": "Returns: {Buffer | string}",
                    "name": "return",
                    "type": "Buffer | string"
                  },
                  "params": [
                    {
                      "textRaw": "`privateKey` {Object | string | Buffer | KeyObject}",
                      "name": "privateKey",
                      "type": "Object | string | Buffer | KeyObject",
                      "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."
                    }
                  ]
                }
              ],
              "desc": "<p>Calculates the signature on all the data passed through using either\n<a href=\"crypto.html#crypto_sign_update_data_inputencoding\"><code>sign.update()</code></a> or <a href=\"stream.html#stream_writable_write_chunk_encoding_callback\"><code>sign.write()</code></a>.</p>\n<p>If <code>privateKey</code> is not a <a href=\"crypto.html#crypto_class_keyobject\"><code>KeyObject</code></a>, this function behaves as if\n<code>privateKey</code> had been passed to <a href=\"crypto.html#crypto_crypto_createprivatekey_key\"><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/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string&gt;</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/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;integer&gt;</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/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;integer&gt;</a> Salt length for when padding is\n<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])`",
              "type": "method",
              "name": "update",
              "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."
                    }
                  ]
                }
              ],
              "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`",
          "type": "class",
          "name": "Verify",
          "meta": {
            "added": [
              "v0.1.92"
            ],
            "changes": []
          },
          "desc": "<ul>\n<li>Extends: <a href=\"stream.html#stream_class_stream_writable\" class=\"type\">&lt;stream.Writable&gt;</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=\"crypto.html#crypto_verify_update_data_inputencoding\"><code>verify.update()</code></a> and <a href=\"crypto.html#crypto_verify_verify_object_signature_signatureencoding\"><code>verify.verify()</code></a> methods to verify\nthe signature.</li>\n</ul>\n<p>The <a href=\"crypto.html#crypto_crypto_createverify_algorithm_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=\"crypto.html#crypto_class_sign\"><code>Sign</code></a> for examples.</p>",
          "methods": [
            {
              "textRaw": "`verify.update(data[, inputEncoding])`",
              "type": "method",
              "name": "update",
              "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."
                    }
                  ]
                }
              ],
              "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(object, signature[, signatureEncoding])`",
              "type": "method",
              "name": "verify",
              "meta": {
                "added": [
                  "v0.1.92"
                ],
                "changes": [
                  {
                    "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": [
                {
                  "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."
                  },
                  "params": [
                    {
                      "textRaw": "`object` {Object | string | Buffer | KeyObject}",
                      "name": "object",
                      "type": "Object | string | Buffer | KeyObject",
                      "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 | Buffer | TypedArray | DataView}",
                      "name": "signature",
                      "type": "string | Buffer | TypedArray | DataView"
                    },
                    {
                      "textRaw": "`signatureEncoding` {string} The [encoding][] of the `signature` string.",
                      "name": "signatureEncoding",
                      "type": "string",
                      "desc": "The [encoding][] of the `signature` string."
                    }
                  ]
                }
              ],
              "desc": "<p>Verifies the provided data using the given <code>object</code> and <code>signature</code>.</p>\n<p>If <code>object</code> is not a <a href=\"crypto.html#crypto_class_keyobject\"><code>KeyObject</code></a>, this function behaves as if\n<code>object</code> had been passed to <a href=\"crypto.html#crypto_crypto_createpublickey_key\"><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/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string&gt;</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/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;integer&gt;</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/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;integer&gt;</a> Salt length for when padding is\n<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>"
            }
          ]
        }
      ],
      "type": "module",
      "displayName": "Crypto"
    },
    {
      "textRaw": "DNS",
      "name": "dns",
      "introduced_in": "v0.10.0",
      "stability": 2,
      "stabilityText": "Stable",
      "desc": "<p>The <code>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=\"dns.html#dns_dns_lookup_hostname_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=\"dns.html#dns_dns_lookup_hostname_options_callback\"><code>dns.lookup()</code></a>.</p>\n<pre><code class=\"language-js\">const dns = require('dns');\n\ndns.lookup('example.org', (err, address, family) => {\n  console.log('address: %j family: IPv%s', address, family);\n});\n// address: \"93.184.216.34\" family: IPv4\n</code></pre>\n<p>All other functions in the <code>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=\"dns.html#dns_dns_lookup_hostname_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-js\">const dns = require('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=\"dns.html#dns_implementation_considerations\">Implementation considerations section</a> for more information.</p>",
      "classes": [
        {
          "textRaw": "Class: `dns.Resolver`",
          "type": "class",
          "name": "dns.Resolver",
          "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=\"dns.html#dns_dns_setservers_servers\"><code>resolver.setServers()</code></a> does not affect\nother resolvers:</p>\n<pre><code class=\"language-js\">const { Resolver } = require('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>dns</code> module are available:</p>\n<ul>\n<li><a href=\"dns.html#dns_dns_getservers\"><code>resolver.getServers()</code></a></li>\n<li><a href=\"dns.html#dns_dns_resolve_hostname_rrtype_callback\"><code>resolver.resolve()</code></a></li>\n<li><a href=\"dns.html#dns_dns_resolve4_hostname_options_callback\"><code>resolver.resolve4()</code></a></li>\n<li><a href=\"dns.html#dns_dns_resolve6_hostname_options_callback\"><code>resolver.resolve6()</code></a></li>\n<li><a href=\"dns.html#dns_dns_resolveany_hostname_callback\"><code>resolver.resolveAny()</code></a></li>\n<li><a href=\"dns.html#dns_dns_resolvecname_hostname_callback\"><code>resolver.resolveCname()</code></a></li>\n<li><a href=\"dns.html#dns_dns_resolvemx_hostname_callback\"><code>resolver.resolveMx()</code></a></li>\n<li><a href=\"dns.html#dns_dns_resolvenaptr_hostname_callback\"><code>resolver.resolveNaptr()</code></a></li>\n<li><a href=\"dns.html#dns_dns_resolvens_hostname_callback\"><code>resolver.resolveNs()</code></a></li>\n<li><a href=\"dns.html#dns_dns_resolveptr_hostname_callback\"><code>resolver.resolvePtr()</code></a></li>\n<li><a href=\"dns.html#dns_dns_resolvesoa_hostname_callback\"><code>resolver.resolveSoa()</code></a></li>\n<li><a href=\"dns.html#dns_dns_resolvesrv_hostname_callback\"><code>resolver.resolveSrv()</code></a></li>\n<li><a href=\"dns.html#dns_dns_resolvetxt_hostname_callback\"><code>resolver.resolveTxt()</code></a></li>\n<li><a href=\"dns.html#dns_dns_reverse_ip_callback\"><code>resolver.reverse()</code></a></li>\n<li><a href=\"dns.html#dns_dns_setservers_servers\"><code>resolver.setServers()</code></a></li>\n</ul>",
          "methods": [
            {
              "textRaw": "`Resolver([options])`",
              "type": "method",
              "name": "Resolver",
              "meta": {
                "added": [
                  "v8.3.0"
                ],
                "changes": [
                  {
                    "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": []
                }
              ],
              "desc": "<p>Create a new resolver.</p>\n<ul>\n<li>\n<p><code>options</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object\" class=\"type\">&lt;Object&gt;</a></p>\n<ul>\n<li><code>timeout</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;integer&gt;</a> Query timeout in milliseconds, or <code>-1</code> to use the\ndefault timeout.</li>\n</ul>\n</li>\n</ul>"
            },
            {
              "textRaw": "`resolver.cancel()`",
              "type": "method",
              "name": "cancel",
              "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>"
            }
          ]
        }
      ],
      "methods": [
        {
          "textRaw": "`dns.getServers()`",
          "type": "method",
          "name": "getServers",
          "meta": {
            "added": [
              "v0.11.3"
            ],
            "changes": []
          },
          "signatures": [
            {
              "return": {
                "textRaw": "Returns: {string[]}",
                "name": "return",
                "type": "string[]"
              },
              "params": []
            }
          ],
          "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<!-- eslint-disable semi-->\n<pre><code class=\"language-js\">[\n  '4.4.4.4',\n  '2001:4860:4860::8888',\n  '4.4.4.4:1053',\n  '[2001:4860:4860::8888]:1053'\n]\n</code></pre>"
        },
        {
          "textRaw": "`dns.lookup(hostname[, options], callback)`",
          "type": "method",
          "name": "lookup",
          "meta": {
            "added": [
              "v0.1.90"
            ],
            "changes": [
              {
                "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} The record family. Must be `4`, `6`, or `0`. The value `0` indicates that IPv4 and IPv6 addresses are both returned. **Default:** `0`.",
                      "name": "family",
                      "type": "integer",
                      "default": "`0`",
                      "desc": "The record family. Must be `4`, `6`, or `0`. The value `0` indicates that IPv4 and IPv6 addresses are both returned."
                    },
                    {
                      "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": "`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. **Default:** currently `false` (addresses are reordered) but this is expected to change in the not too distant future. New code should use `{ verbatim: true }`.",
                      "name": "verbatim",
                      "type": "boolean",
                      "default": "currently `false` (addresses are reordered) but this is expected to change in the not too distant future. New code should use `{ verbatim: true }`",
                      "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."
                    }
                  ]
                },
                {
                  "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.",
                      "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`, 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.",
                      "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."
                    }
                  ]
                }
              ]
            }
          ],
          "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 IPv4\nand IPv6 addresses are both 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#errors_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=\"dns.html#dns_implementation_considerations\">Implementation considerations section</a> before using\n<code>dns.lookup()</code>.</p>\n<p>Example usage:</p>\n<pre><code class=\"language-js\">const dns = require('dns');\nconst options = {\n  family: 6,\n  hints: dns.ADDRCONFIG | dns.V4MAPPED,\n};\ndns.lookup('example.com', options, (err, address, family) =>\n  console.log('address: %j family: IPv%s', address, family));\n// address: \"2606:2800:220:1:248:1893:25c8:1946\" family: IPv6\n\n// When options.all is true, the result will be an Array.\noptions.all = true;\ndns.lookup('example.com', options, (err, addresses) =>\n  console.log('addresses: %j', addresses));\n// addresses: [{\"address\":\"2606:2800:220:1:248:1893:25c8:1946\",\"family\":6}]\n</code></pre>\n<p>If this method is invoked as its <a href=\"util.html#util_util_promisify_original\"><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",
              "meta": {
                "changes": [
                  {
                    "version": "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=\"dns.html#dns_dns_lookup_hostname_options_callback\"><code>dns.lookup()</code></a>.</p>\n<ul>\n<li><code>dns.ADDRCONFIG</code>: Returned address types are determined by the types\nof addresses supported by the current system. For example, IPv4 addresses\nare only returned if the current system has at least one IPv4 address\nconfigured. Loopback addresses are not considered.</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>",
              "type": "module",
              "displayName": "Supported getaddrinfo flags"
            }
          ]
        },
        {
          "textRaw": "`dns.lookupService(address, port, callback)`",
          "type": "method",
          "name": "lookupService",
          "meta": {
            "added": [
              "v0.11.14"
            ],
            "changes": []
          },
          "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#errors_class_error\"><code>Error</code></a> object, where <code>err.code</code> is the error code.</p>\n<pre><code class=\"language-js\">const dns = require('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#util_util_promisify_original\"><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)`",
          "type": "method",
          "name": "resolve",
          "meta": {
            "added": [
              "v0.1.27"
            ],
            "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."
                },
                {
                  "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/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string&gt;</a></td>\n<td><a href=\"dns.html#dns_dns_resolve4_hostname_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/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string&gt;</a></td>\n<td><a href=\"dns.html#dns_dns_resolve6_hostname_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/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object\" class=\"type\">&lt;Object&gt;</a></td>\n<td><a href=\"dns.html#dns_dns_resolveany_hostname_callback\"><code>dns.resolveAny()</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/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string&gt;</a></td>\n<td><a href=\"dns.html#dns_dns_resolvecname_hostname_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/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object\" class=\"type\">&lt;Object&gt;</a></td>\n<td><a href=\"dns.html#dns_dns_resolvemx_hostname_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/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object\" class=\"type\">&lt;Object&gt;</a></td>\n<td><a href=\"dns.html#dns_dns_resolvenaptr_hostname_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/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string&gt;</a></td>\n<td><a href=\"dns.html#dns_dns_resolvens_hostname_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/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string&gt;</a></td>\n<td><a href=\"dns.html#dns_dns_resolveptr_hostname_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/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object\" class=\"type\">&lt;Object&gt;</a></td>\n<td><a href=\"dns.html#dns_dns_resolvesoa_hostname_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/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object\" class=\"type\">&lt;Object&gt;</a></td>\n<td><a href=\"dns.html#dns_dns_resolvesrv_hostname_callback\"><code>dns.resolveSrv()</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/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string[]&gt;</a></td>\n<td><a href=\"dns.html#dns_dns_resolvetxt_hostname_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#errors_class_error\"><code>Error</code></a> object, where <code>err.code</code> is one of the\n<a href=\"dns.html#dns_error_codes\">DNS error codes</a>.</p>"
        },
        {
          "textRaw": "`dns.resolve4(hostname[, options], callback)`",
          "type": "method",
          "name": "resolve4",
          "meta": {
            "added": [
              "v0.1.16"
            ],
            "changes": [
              {
                "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: '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 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."
                    }
                  ]
                },
                {
                  "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)`",
          "type": "method",
          "name": "resolve6",
          "meta": {
            "added": [
              "v0.1.16"
            ],
            "changes": [
              {
                "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."
                    }
                  ]
                },
                {
                  "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 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)`",
          "type": "method",
          "name": "resolveAny",
          "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>'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=\"dns.html#dns_dns_resolvemx_hostname_callback\"><code>dns.resolveMx()</code></a></td>\n</tr>\n<tr>\n<td><code>'NAPTR'</code></td>\n<td>Refer to <a href=\"dns.html#dns_dns_resolvenaptr_hostname_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=\"dns.html#dns_dns_resolvesoa_hostname_callback\"><code>dns.resolveSoa()</code></a></td>\n</tr>\n<tr>\n<td><code>'SRV'</code></td>\n<td>Refer to <a href=\"dns.html#dns_dns_resolvesrv_hostname_callback\"><code>dns.resolveSrv()</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=\"dns.html#dns_dns_resolvetxt_hostname_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<!-- eslint-disable semi -->\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=\"dns.html#dns_dns_resolve4_hostname_options_callback\"><code>dns.resolve4()</code></a>,\n<a href=\"dns.html#dns_dns_resolvemx_hostname_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)`",
          "type": "method",
          "name": "resolveCname",
          "meta": {
            "added": [
              "v0.3.2"
            ],
            "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": "`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.resolveMx(hostname, callback)`",
          "type": "method",
          "name": "resolveMx",
          "meta": {
            "added": [
              "v0.1.27"
            ],
            "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": "`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)`",
          "type": "method",
          "name": "resolveNaptr",
          "meta": {
            "added": [
              "v0.9.12"
            ],
            "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": "`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<!-- eslint-skip -->\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)`",
          "type": "method",
          "name": "resolveNs",
          "meta": {
            "added": [
              "v0.1.90"
            ],
            "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": "`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)`",
          "type": "method",
          "name": "resolvePtr",
          "meta": {
            "added": [
              "v6.0.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": "`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)`",
          "type": "method",
          "name": "resolveSoa",
          "meta": {
            "added": [
              "v0.11.10"
            ],
            "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": "`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<!-- eslint-skip -->\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)`",
          "type": "method",
          "name": "resolveSrv",
          "meta": {
            "added": [
              "v0.1.27"
            ],
            "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": "`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<!-- eslint-skip -->\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.resolveTxt(hostname, callback)`",
          "type": "method",
          "name": "resolveTxt",
          "meta": {
            "added": [
              "v0.1.27"
            ],
            "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` <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string[][]&gt;</a>",
                      "name": "records",
                      "desc": "<a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string[][]&gt;</a>"
                    }
                  ]
                }
              ]
            }
          ],
          "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)`",
          "type": "method",
          "name": "reverse",
          "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#errors_class_error\"><code>Error</code></a> object, where <code>err.code</code> is\none of the <a href=\"dns.html#dns_error_codes\">DNS error codes</a>.</p>"
        },
        {
          "textRaw": "`dns.setServers(servers)`",
          "type": "method",
          "name": "setServers",
          "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  '4.4.4.4',\n  '[2001:4860:4860::8888]',\n  '4.4.4.4: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=\"dns.html#dns_dns_setservers_servers\"><code>dns.setServers()</code></a> method affects only <a href=\"dns.html#dns_dns_resolve_hostname_rrtype_callback\"><code>dns.resolve()</code></a>,\n<code>dns.resolve*()</code> and <a href=\"dns.html#dns_dns_reverse_ip_callback\"><code>dns.reverse()</code></a> (and specifically <em>not</em>\n<a href=\"dns.html#dns_dns_lookup_hostname_options_callback\"><code>dns.lookup()</code></a>).</p>\n<p>This method works much like\n<a href=\"http://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",
          "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('dns').promises</code>.</p>",
          "classes": [
            {
              "textRaw": "Class: `dnsPromises.Resolver`",
              "type": "class",
              "name": "dnsPromises.Resolver",
              "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=\"dns.html#dns_dnspromises_setservers_servers\"><code>resolver.setServers()</code></a> does not affect\nother resolvers:</p>\n<pre><code class=\"language-js\">const { Resolver } = require('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=\"dns.html#dns_dnspromises_getservers\"><code>resolver.getServers()</code></a></li>\n<li><a href=\"dns.html#dns_dnspromises_resolve_hostname_rrtype\"><code>resolver.resolve()</code></a></li>\n<li><a href=\"dns.html#dns_dnspromises_resolve4_hostname_options\"><code>resolver.resolve4()</code></a></li>\n<li><a href=\"dns.html#dns_dnspromises_resolve6_hostname_options\"><code>resolver.resolve6()</code></a></li>\n<li><a href=\"dns.html#dns_dnspromises_resolveany_hostname\"><code>resolver.resolveAny()</code></a></li>\n<li><a href=\"dns.html#dns_dnspromises_resolvecname_hostname\"><code>resolver.resolveCname()</code></a></li>\n<li><a href=\"dns.html#dns_dnspromises_resolvemx_hostname\"><code>resolver.resolveMx()</code></a></li>\n<li><a href=\"dns.html#dns_dnspromises_resolvenaptr_hostname\"><code>resolver.resolveNaptr()</code></a></li>\n<li><a href=\"dns.html#dns_dnspromises_resolvens_hostname\"><code>resolver.resolveNs()</code></a></li>\n<li><a href=\"dns.html#dns_dnspromises_resolveptr_hostname\"><code>resolver.resolvePtr()</code></a></li>\n<li><a href=\"dns.html#dns_dnspromises_resolvesoa_hostname\"><code>resolver.resolveSoa()</code></a></li>\n<li><a href=\"dns.html#dns_dnspromises_resolvesrv_hostname\"><code>resolver.resolveSrv()</code></a></li>\n<li><a href=\"dns.html#dns_dnspromises_resolvetxt_hostname\"><code>resolver.resolveTxt()</code></a></li>\n<li><a href=\"dns.html#dns_dnspromises_reverse_ip\"><code>resolver.reverse()</code></a></li>\n<li><a href=\"dns.html#dns_dnspromises_setservers_servers\"><code>resolver.setServers()</code></a></li>\n</ul>"
            }
          ],
          "methods": [
            {
              "textRaw": "`dnsPromises.getServers()`",
              "type": "method",
              "name": "getServers",
              "meta": {
                "added": [
                  "v10.6.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {string[]}",
                    "name": "return",
                    "type": "string[]"
                  },
                  "params": []
                }
              ],
              "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<!-- eslint-disable semi-->\n<pre><code class=\"language-js\">[\n  '4.4.4.4',\n  '2001:4860:4860::8888',\n  '4.4.4.4:1053',\n  '[2001:4860:4860::8888]:1053'\n]\n</code></pre>"
            },
            {
              "textRaw": "`dnsPromises.lookup(hostname[, options])`",
              "type": "method",
              "name": "lookup",
              "meta": {
                "added": [
                  "v10.6.0"
                ],
                "changes": []
              },
              "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 IPv4 and IPv6 addresses are both returned. **Default:** `0`.",
                          "name": "family",
                          "type": "integer",
                          "default": "`0`",
                          "desc": "The record family. Must be `4`, `6`, or `0`. The value `0` indicates that IPv4 and IPv6 addresses are both returned."
                        },
                        {
                          "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": "`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. **Default:** currently `false` (addresses are reordered) but this is expected to change in the not too distant future. New code should use `{ verbatim: true }`.",
                          "name": "verbatim",
                          "type": "boolean",
                          "default": "currently `false` (addresses are reordered) but this is expected to change in the not too distant future. New code should use `{ verbatim: true }`",
                          "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."
                        }
                      ]
                    }
                  ]
                }
              ],
              "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 IPv4\nand IPv6 addresses are both 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#errors_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=\"dns.html#dns_dnspromises_lookup_hostname_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=\"dns.html#dns_implementation_considerations\">Implementation considerations section</a> before\nusing <code>dnsPromises.lookup()</code>.</p>\n<p>Example usage:</p>\n<pre><code class=\"language-js\">const dns = require('dns');\nconst dnsPromises = dns.promises;\nconst options = {\n  family: 6,\n  hints: dns.ADDRCONFIG | dns.V4MAPPED,\n};\n\ndnsPromises.lookup('example.com', options).then((result) => {\n  console.log('address: %j family: IPv%s', result.address, result.family);\n  // address: \"2606:2800:220:1:248:1893:25c8:1946\" family: IPv6\n});\n\n// When options.all is true, the result will be an Array.\noptions.all = true;\ndnsPromises.lookup('example.com', options).then((result) => {\n  console.log('addresses: %j', result);\n  // addresses: [{\"address\":\"2606:2800:220:1:248:1893:25c8:1946\",\"family\":6}]\n});\n</code></pre>"
            },
            {
              "textRaw": "`dnsPromises.lookupService(address, port)`",
              "type": "method",
              "name": "lookupService",
              "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#errors_class_error\"><code>Error</code></a> object, where <code>err.code</code>\nis the error code.</p>\n<pre><code class=\"language-js\">const dnsPromises = require('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])`",
              "type": "method",
              "name": "resolve",
              "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."
                    }
                  ]
                }
              ],
              "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/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string&gt;</a></td>\n<td><a href=\"dns.html#dns_dnspromises_resolve4_hostname_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/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string&gt;</a></td>\n<td><a href=\"dns.html#dns_dnspromises_resolve6_hostname_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/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object\" class=\"type\">&lt;Object&gt;</a></td>\n<td><a href=\"dns.html#dns_dnspromises_resolveany_hostname\"><code>dnsPromises.resolveAny()</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/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string&gt;</a></td>\n<td><a href=\"dns.html#dns_dnspromises_resolvecname_hostname\"><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/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object\" class=\"type\">&lt;Object&gt;</a></td>\n<td><a href=\"dns.html#dns_dnspromises_resolvemx_hostname\"><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/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object\" class=\"type\">&lt;Object&gt;</a></td>\n<td><a href=\"dns.html#dns_dnspromises_resolvenaptr_hostname\"><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/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string&gt;</a></td>\n<td><a href=\"dns.html#dns_dnspromises_resolvens_hostname\"><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/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string&gt;</a></td>\n<td><a href=\"dns.html#dns_dnspromises_resolveptr_hostname\"><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/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object\" class=\"type\">&lt;Object&gt;</a></td>\n<td><a href=\"dns.html#dns_dnspromises_resolvesoa_hostname\"><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/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object\" class=\"type\">&lt;Object&gt;</a></td>\n<td><a href=\"dns.html#dns_dnspromises_resolvesrv_hostname\"><code>dnsPromises.resolveSrv()</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/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string[]&gt;</a></td>\n<td><a href=\"dns.html#dns_dnspromises_resolvetxt_hostname\"><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#errors_class_error\"><code>Error</code></a> object, where <code>err.code</code>\nis one of the <a href=\"dns.html#dns_error_codes\">DNS error codes</a>.</p>"
            },
            {
              "textRaw": "`dnsPromises.resolve4(hostname[, options])`",
              "type": "method",
              "name": "resolve4",
              "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."
                        }
                      ]
                    }
                  ]
                }
              ],
              "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])`",
              "type": "method",
              "name": "resolve6",
              "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."
                        }
                      ]
                    }
                  ]
                }
              ],
              "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)`",
              "type": "method",
              "name": "resolveAny",
              "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>'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=\"dns.html#dns_dnspromises_resolvemx_hostname\"><code>dnsPromises.resolveMx()</code></a></td>\n</tr>\n<tr>\n<td><code>'NAPTR'</code></td>\n<td>Refer to <a href=\"dns.html#dns_dnspromises_resolvenaptr_hostname\"><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=\"dns.html#dns_dnspromises_resolvesoa_hostname\"><code>dnsPromises.resolveSoa()</code></a></td>\n</tr>\n<tr>\n<td><code>'SRV'</code></td>\n<td>Refer to <a href=\"dns.html#dns_dnspromises_resolvesrv_hostname\"><code>dnsPromises.resolveSrv()</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=\"dns.html#dns_dnspromises_resolvetxt_hostname\"><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<!-- eslint-disable semi -->\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.resolveCname(hostname)`",
              "type": "method",
              "name": "resolveCname",
              "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)`",
              "type": "method",
              "name": "resolveMx",
              "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)`",
              "type": "method",
              "name": "resolveNaptr",
              "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<!-- eslint-skip -->\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)`",
              "type": "method",
              "name": "resolveNs",
              "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)`",
              "type": "method",
              "name": "resolvePtr",
              "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)`",
              "type": "method",
              "name": "resolveSoa",
              "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<!-- eslint-skip -->\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)`",
              "type": "method",
              "name": "resolveSrv",
              "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<!-- eslint-skip -->\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.resolveTxt(hostname)`",
              "type": "method",
              "name": "resolveTxt",
              "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)`",
              "type": "method",
              "name": "reverse",
              "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#errors_class_error\"><code>Error</code></a> object, where <code>err.code</code>\nis one of the <a href=\"dns.html#dns_error_codes\">DNS error codes</a>.</p>"
            },
            {
              "textRaw": "`dnsPromises.setServers(servers)`",
              "type": "method",
              "name": "setServers",
              "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  '4.4.4.4',\n  '[2001:4860:4860::8888]',\n  '4.4.4.4: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=\"http://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>"
            }
          ],
          "type": "module",
          "displayName": "DNS promises API"
        },
        {
          "textRaw": "Error codes",
          "name": "error_codes",
          "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 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 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>",
          "type": "module",
          "displayName": "Error codes"
        },
        {
          "textRaw": "Implementation considerations",
          "name": "implementation_considerations",
          "desc": "<p>Although <a href=\"dns.html#dns_dns_lookup_hostname_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()`",
              "type": "method",
              "name": "lookup",
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Under the hood, <a href=\"dns.html#dns_dns_lookup_hostname_options_callback\"><code>dns.lookup()</code></a> uses the same operating system facilities\nas most other programs. For instance, <a href=\"dns.html#dns_dns_lookup_hostname_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=\"dns.html#dns_dns_lookup_hostname_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#cli_uv_threadpool_size_size\"><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#net_socket_connect_options_connectlistener\"><code>socket.connect()</code></a> and <a href=\"dgram.html#dgram_dgram_createsocket_options_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()`",
              "desc": "<p>These functions are implemented quite differently than <a href=\"dns.html#dns_dns_lookup_hostname_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=\"dns.html#dns_dns_lookup_hostname_options_callback\"><code>dns.lookup()</code></a> can have.</p>\n<p>They do not use the same set of configuration files than what <a href=\"dns.html#dns_dns_lookup_hostname_options_callback\"><code>dns.lookup()</code></a>\nuses. For instance, <em>they do not use the configuration from <code>/etc/hosts</code></em>.</p>",
              "type": "module",
              "displayName": "`dns.resolve()`, `dns.resolve*()` and `dns.reverse()`"
            }
          ],
          "type": "module",
          "displayName": "Implementation considerations"
        }
      ],
      "type": "module",
      "displayName": "DNS"
    },
    {
      "textRaw": "Domain",
      "name": "domain",
      "meta": {
        "changes": [
          {
            "version": "v8.8.0",
            "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."
          }
        ]
      },
      "introduced_in": "v0.10.0",
      "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 end users 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 master 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('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  // resources like crazy 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('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('cluster');\nconst PORT = +process.env.PORT || 1337;\n\nif (cluster.isMaster) {\n  // A more realistic scenario would have more than 2 workers,\n  // and perhaps not put the master 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 master 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('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('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 master know we're dead. This will trigger a\n        // 'disconnect' in the cluster master, 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 lowlevel 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('domain');\nconst http = require('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()`",
          "type": "method",
          "name": "create",
          "signatures": [
            {
              "return": {
                "textRaw": "Returns: {Domain}",
                "name": "return",
                "type": "Domain"
              },
              "params": []
            }
          ]
        }
      ],
      "classes": [
        {
          "textRaw": "Class: `Domain`",
          "type": "class",
          "name": "Domain",
          "desc": "<ul>\n<li>Extends: <a href=\"events.html#events_class_eventemitter\" class=\"type\">&lt;EventEmitter&gt;</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": "`members` {Array}",
              "type": "Array",
              "name": "members",
              "desc": "<p>An array of timers and event emitters that have been explicitly added\nto the domain.</p>"
            }
          ],
          "methods": [
            {
              "textRaw": "`domain.add(emitter)`",
              "type": "method",
              "name": "add",
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`emitter` {EventEmitter|Timer} emitter or timer to be added to the domain",
                      "name": "emitter",
                      "type": "EventEmitter|Timer",
                      "desc": "emitter or timer 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>This also works with timers that are returned from <a href=\"timers.html#timers_setinterval_callback_delay_args\"><code>setInterval()</code></a> and\n<a href=\"timers.html#timers_settimeout_callback_delay_args\"><code>setTimeout()</code></a>. If their callback function throws, it will be caught by\nthe domain <code>'error'</code> handler.</p>\n<p>If the Timer or <code>EventEmitter</code> was already bound to a domain, it is removed\nfrom that one, and bound to this one instead.</p>"
            },
            {
              "textRaw": "`domain.bind(callback)`",
              "type": "method",
              "name": "bind",
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Function} The bound function",
                    "name": "return",
                    "type": "Function",
                    "desc": "The bound function"
                  },
                  "params": [
                    {
                      "textRaw": "`callback` {Function} The callback function",
                      "name": "callback",
                      "type": "Function",
                      "desc": "The callback 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()`",
              "type": "method",
              "name": "enter",
              "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=\"domain.html#domain_domain_exit\"><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()`",
              "type": "method",
              "name": "exit",
              "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)`",
              "type": "method",
              "name": "intercept",
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Function} The intercepted function",
                    "name": "return",
                    "type": "Function",
                    "desc": "The intercepted function"
                  },
                  "params": [
                    {
                      "textRaw": "`callback` {Function} The callback function",
                      "name": "callback",
                      "type": "Function",
                      "desc": "The callback function"
                    }
                  ]
                }
              ],
              "desc": "<p>This method is almost identical to <a href=\"domain.html#domain_domain_bind_callback\"><code>domain.bind(callback)</code></a>. However, in\naddition to catching thrown errors, it will also intercept <a href=\"errors.html#errors_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)`",
              "type": "method",
              "name": "remove",
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`emitter` {EventEmitter|Timer} emitter or timer to be removed from the domain",
                      "name": "emitter",
                      "type": "EventEmitter|Timer",
                      "desc": "emitter or timer to be removed from the domain"
                    }
                  ]
                }
              ],
              "desc": "<p>The opposite of <a href=\"domain.html#domain_domain_add_emitter\"><code>domain.add(emitter)</code></a>. Removes domain handling from the\nspecified emitter.</p>"
            },
            {
              "textRaw": "`domain.run(fn[, ...args])`",
              "type": "method",
              "name": "run",
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`fn` {Function}",
                      "name": "fn",
                      "type": "Function"
                    },
                    {
                      "textRaw": "`...args` {any}",
                      "name": "...args",
                      "type": "any"
                    }
                  ]
                }
              ],
              "desc": "<p>Run the supplied function in the context of the domain, implicitly\nbinding all event emitters, timers, and lowlevel 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('domain');\nconst fs = require('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",
          "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=\"domain.html#domain_domain_bind_callback\"><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>",
          "type": "module",
          "displayName": "Domains and promises"
        }
      ],
      "type": "module",
      "displayName": "Domain"
    },
    {
      "textRaw": "Events",
      "name": "Events",
      "introduced_in": "v0.10.0",
      "stability": 2,
      "stabilityText": "Stable",
      "type": "module",
      "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#net_class_net_server\"><code>net.Server</code></a> object emits an event each time a peer\nconnects to it; a <a href=\"fs.html#fs_class_fs_readstream\"><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 will be 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-js\">const EventEmitter = require('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",
          "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-js\">const myEmitter = new MyEmitter();\nmyEmitter.on('event', function(a, b) {\n  console.log(a, b, this, this === myEmitter);\n  // Prints:\n  //   a b MyEmitter {\n  //     domain: null,\n  //     _events: { event: [Function] },\n  //     _eventsCount: 1,\n  //     _maxListeners: undefined } 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-js\">const 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>",
          "type": "module",
          "displayName": "Passing arguments and `this` to listeners"
        },
        {
          "textRaw": "Asynchronous vs. synchronous",
          "name": "asynchronous_vs._synchronous",
          "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-js\">const 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>",
          "type": "module",
          "displayName": "Asynchronous vs. synchronous"
        },
        {
          "textRaw": "Handling events only once",
          "name": "handling_events_only_once",
          "desc": "<p>When a listener is registered using the <code>eventEmitter.on()</code> method, that\nlistener will be invoked <em>every time</em> the named event is emitted.</p>\n<pre><code class=\"language-js\">const 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-js\">const 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>",
          "type": "module",
          "displayName": "Handling events only once"
        },
        {
          "textRaw": "Error events",
          "name": "error_events",
          "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-js\">const 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>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-js\">const 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>errorMonitor</code>.</p>\n<pre><code class=\"language-js\">const myEmitter = new MyEmitter();\nmyEmitter.on(EventEmitter.errorMonitor, (err) => {\n  MyMonitoringTool.log(err);\n});\nmyEmitter.emit('error', new Error('whoops!'));\n// Still throws and crashes Node.js\n</code></pre>",
          "type": "module",
          "displayName": "Error events"
        },
        {
          "textRaw": "Capture rejections of promises",
          "name": "capture_rejections_of_promises",
          "stability": 1,
          "stabilityText": "captureRejections is experimental.",
          "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-js\">const 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=\"events.html#events_emitter_symbol_for_nodejs_rejection_err_eventname_args\"><code>Symbol.for('nodejs.rejection')</code></a> method\nif there is one, or to <a href=\"events.html#events_error_events\"><code>'error'</code></a> event handler if there is none.</p>\n<pre><code class=\"language-js\">const 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>EventEmitter.captureRejections = true</code> will change the default for all\nnew instances of <code>EventEmitter</code>.</p>\n<pre><code class=\"language-js\">EventEmitter.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<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>",
          "type": "module",
          "displayName": "Capture rejections of promises"
        }
      ],
      "classes": [
        {
          "textRaw": "Class: `EventEmitter`",
          "type": "class",
          "name": "EventEmitter",
          "meta": {
            "added": [
              "v0.1.26"
            ],
            "changes": [
              {
                "version": "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>events</code> module:</p>\n<pre><code class=\"language-js\">const EventEmitter = require('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/en-US/docs/Web/JavaScript/Data_structures#Boolean_type\" class=\"type\">&lt;boolean&gt;</a> It enables\n<a href=\"events.html#events_capture_rejections_of_promises\">automatic capturing of promise rejection</a>.\nDefault: <code>false</code>.</li>\n</ul>",
          "events": [
            {
              "textRaw": "Event: 'newListener'",
              "type": "event",
              "name": "newListener",
              "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 will be 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 will be inserted <em>before</em> the\nlistener that is in the process of being added.</p>\n<pre><code class=\"language-js\">const 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'`",
              "type": "event",
              "name": "removeListener",
              "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": "`EventEmitter.listenerCount(emitter, eventName)`",
              "type": "method",
              "name": "listenerCount",
              "meta": {
                "added": [
                  "v0.9.12"
                ],
                "deprecated": [
                  "v4.0.0"
                ],
                "changes": []
              },
              "stability": 0,
              "stabilityText": "Deprecated: Use [`emitter.listenerCount()`][] instead.",
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`emitter` {EventEmitter} The emitter to query",
                      "name": "emitter",
                      "type": "EventEmitter",
                      "desc": "The emitter to query"
                    },
                    {
                      "textRaw": "`eventName` {string|symbol} The event name",
                      "name": "eventName",
                      "type": "string|symbol",
                      "desc": "The event name"
                    }
                  ]
                }
              ],
              "desc": "<p>A class method that returns the number of listeners for the given <code>eventName</code>\nregistered on the given <code>emitter</code>.</p>\n<pre><code class=\"language-js\">const myEmitter = new MyEmitter();\nmyEmitter.on('event', () => {});\nmyEmitter.on('event', () => {});\nconsole.log(EventEmitter.listenerCount(myEmitter, 'event'));\n// Prints: 2\n</code></pre>"
            },
            {
              "textRaw": "`emitter.addListener(eventName, listener)`",
              "type": "method",
              "name": "addListener",
              "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])`",
              "type": "method",
              "name": "emit",
              "meta": {
                "added": [
                  "v0.1.26"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  },
                  "params": [
                    {
                      "textRaw": "`eventName` {string|symbol}",
                      "name": "eventName",
                      "type": "string|symbol"
                    },
                    {
                      "textRaw": "`...args` {any}",
                      "name": "...args",
                      "type": "any"
                    }
                  ]
                }
              ],
              "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-js\">const EventEmitter = require('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()`",
              "type": "method",
              "name": "eventNames",
              "meta": {
                "added": [
                  "v6.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Array}",
                    "name": "return",
                    "type": "Array"
                  },
                  "params": []
                }
              ],
              "desc": "<p>Returns an array listing the events for which the emitter has registered\nlisteners. The values in the array will be strings or <code>Symbol</code>s.</p>\n<pre><code class=\"language-js\">const EventEmitter = require('events');\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()`",
              "type": "method",
              "name": "getMaxListeners",
              "meta": {
                "added": [
                  "v1.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {integer}",
                    "name": "return",
                    "type": "integer"
                  },
                  "params": []
                }
              ],
              "desc": "<p>Returns the current max listener value for the <code>EventEmitter</code> which is either\nset by <a href=\"events.html#events_emitter_setmaxlisteners_n\"><code>emitter.setMaxListeners(n)</code></a> or defaults to\n<a href=\"events.html#events_eventemitter_defaultmaxlisteners\"><code>EventEmitter.defaultMaxListeners</code></a>.</p>"
            },
            {
              "textRaw": "`emitter.listenerCount(eventName)`",
              "type": "method",
              "name": "listenerCount",
              "meta": {
                "added": [
                  "v3.2.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {integer}",
                    "name": "return",
                    "type": "integer"
                  },
                  "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"
                    }
                  ]
                }
              ],
              "desc": "<p>Returns the number of listeners listening to the event named <code>eventName</code>.</p>"
            },
            {
              "textRaw": "`emitter.listeners(eventName)`",
              "type": "method",
              "name": "listeners",
              "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": [
                {
                  "return": {
                    "textRaw": "Returns: {Function[]}",
                    "name": "return",
                    "type": "Function[]"
                  },
                  "params": [
                    {
                      "textRaw": "`eventName` {string|symbol}",
                      "name": "eventName",
                      "type": "string|symbol"
                    }
                  ]
                }
              ],
              "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)`",
              "type": "method",
              "name": "off",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {EventEmitter}",
                    "name": "return",
                    "type": "EventEmitter"
                  },
                  "params": [
                    {
                      "textRaw": "`eventName` {string|symbol}",
                      "name": "eventName",
                      "type": "string|symbol"
                    },
                    {
                      "textRaw": "`listener` {Function}",
                      "name": "listener",
                      "type": "Function"
                    }
                  ]
                }
              ],
              "desc": "<p>Alias for <a href=\"events.html#events_emitter_removelistener_eventname_listener\"><code>emitter.removeListener()</code></a>.</p>"
            },
            {
              "textRaw": "`emitter.on(eventName, listener)`",
              "type": "method",
              "name": "on",
              "meta": {
                "added": [
                  "v0.1.101"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {EventEmitter}",
                    "name": "return",
                    "type": "EventEmitter"
                  },
                  "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"
                    }
                  ]
                }
              ],
              "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-js\">const 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)`",
              "type": "method",
              "name": "once",
              "meta": {
                "added": [
                  "v0.3.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {EventEmitter}",
                    "name": "return",
                    "type": "EventEmitter"
                  },
                  "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"
                    }
                  ]
                }
              ],
              "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-js\">const 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)`",
              "type": "method",
              "name": "prependListener",
              "meta": {
                "added": [
                  "v6.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {EventEmitter}",
                    "name": "return",
                    "type": "EventEmitter"
                  },
                  "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"
                    }
                  ]
                }
              ],
              "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)`",
              "type": "method",
              "name": "prependOnceListener",
              "meta": {
                "added": [
                  "v6.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {EventEmitter}",
                    "name": "return",
                    "type": "EventEmitter"
                  },
                  "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"
                    }
                  ]
                }
              ],
              "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])`",
              "type": "method",
              "name": "removeAllListeners",
              "meta": {
                "added": [
                  "v0.1.26"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {EventEmitter}",
                    "name": "return",
                    "type": "EventEmitter"
                  },
                  "params": [
                    {
                      "textRaw": "`eventName` {string|symbol}",
                      "name": "eventName",
                      "type": "string|symbol"
                    }
                  ]
                }
              ],
              "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)`",
              "type": "method",
              "name": "removeListener",
              "meta": {
                "added": [
                  "v0.1.26"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {EventEmitter}",
                    "name": "return",
                    "type": "EventEmitter"
                  },
                  "params": [
                    {
                      "textRaw": "`eventName` {string|symbol}",
                      "name": "eventName",
                      "type": "string|symbol"
                    },
                    {
                      "textRaw": "`listener` {Function}",
                      "name": "listener",
                      "type": "Function"
                    }
                  ]
                }
              ],
              "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 has been emitted, all listeners attached to it at the\ntime of emitting will be 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 will behave as expected.</p>\n<pre><code class=\"language-js\">const 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 indices 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-js\">const 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)`",
              "type": "method",
              "name": "setMaxListeners",
              "meta": {
                "added": [
                  "v0.3.5"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {EventEmitter}",
                    "name": "return",
                    "type": "EventEmitter"
                  },
                  "params": [
                    {
                      "textRaw": "`n` {integer}",
                      "name": "n",
                      "type": "integer"
                    }
                  ]
                }
              ],
              "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)`",
              "type": "method",
              "name": "rawListeners",
              "meta": {
                "added": [
                  "v9.4.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Function[]}",
                    "name": "return",
                    "type": "Function[]"
                  },
                  "params": [
                    {
                      "textRaw": "`eventName` {string|symbol}",
                      "name": "eventName",
                      "type": "string|symbol"
                    }
                  ]
                }
              ],
              "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-js\">const 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>"
            }
          ],
          "properties": [
            {
              "textRaw": "`EventEmitter.defaultMaxListeners`",
              "name": "defaultMaxListeners",
              "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=\"events.html#events_emitter_setmaxlisteners_n\"><code>emitter.setMaxListeners(n)</code></a> method. To change the default\nfor <em>all</em> <code>EventEmitter</code> instances, the <code>EventEmitter.defaultMaxListeners</code>\nproperty can be used. If this value is not a positive number, a <code>TypeError</code>\nwill be thrown.</p>\n<p>Take caution when setting the <code>EventEmitter.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=\"events.html#events_emitter_setmaxlisteners_n\"><code>emitter.setMaxListeners(n)</code></a> still has\nprecedence over <code>EventEmitter.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<pre><code class=\"language-js\">emitter.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#cli_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#process_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": "`EventEmitter.errorMonitor`",
              "name": "errorMonitor",
              "meta": {
                "added": [
                  "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>"
            }
          ],
          "modules": [
            {
              "textRaw": "`emitter[Symbol.for('nodejs.rejection')](err, eventName[, ...args])`",
              "name": "`emitter[symbol.for('nodejs.rejection')](err,_eventname[,_...args])`",
              "meta": {
                "added": [
                  "v12.16.0"
                ],
                "changes": []
              },
              "stability": 1,
              "stabilityText": "captureRejections is experimental.",
              "desc": "<ul>\n<li><code>err</code> Error</li>\n<li><code>eventName</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string&gt;</a> | <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Symbol_type\" class=\"type\">&lt;symbol&gt;</a></li>\n<li><code>...args</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Data_types\" class=\"type\">&lt;any&gt;</a></li>\n</ul>\n<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=\"events.html#events_capture_rejections_of_promises\"><code>captureRejections</code></a> is enabled on the emitter.\nIt is possible to use <a href=\"events.html#events_events_capturerejectionsymbol\"><code>events.captureRejectionSymbol</code></a> in\nplace of <code>Symbol.for('nodejs.rejection')</code>.</p>\n<pre><code class=\"language-js\">const { EventEmitter, captureRejectionSymbol } = require('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>",
              "type": "module",
              "displayName": "`emitter[Symbol.for('nodejs.rejection')](err, eventName[, ...args])`"
            }
          ]
        }
      ],
      "methods": [
        {
          "textRaw": "`events.once(emitter, name)`",
          "type": "method",
          "name": "once",
          "meta": {
            "added": [
              "v11.13.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "return": {
                "textRaw": "Returns: {Promise}",
                "name": "return",
                "type": "Promise"
              },
              "params": [
                {
                  "textRaw": "`emitter` {EventEmitter}",
                  "name": "emitter",
                  "type": "EventEmitter"
                },
                {
                  "textRaw": "`name` {string}",
                  "name": "name",
                  "type": "string"
                }
              ]
            }
          ],
          "desc": "<p>Creates a <code>Promise</code> that is fulfilled when the <code>EventEmitter</code> emits the given\nevent or that is rejected when the <code>EventEmitter</code> emits <code>'error'</code>.\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-js\">const { once, EventEmitter } = require('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.log('error happened', err);\n  }\n}\n\nrun();\n</code></pre>"
        },
        {
          "textRaw": "events.on(emitter, eventName)",
          "type": "method",
          "name": "on",
          "meta": {
            "added": [
              "v12.16.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "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`"
              },
              "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"
                }
              ]
            }
          ],
          "desc": "<pre><code class=\"language-js\">const { on, EventEmitter } = require('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>"
        }
      ],
      "properties": [
        {
          "textRaw": "events.captureRejections",
          "name": "captureRejections",
          "meta": {
            "added": [
              "v12.16.0"
            ],
            "changes": []
          },
          "stability": 1,
          "stabilityText": "captureRejections is experimental.",
          "desc": "<p>Value: <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type\" class=\"type\">&lt;boolean&gt;</a></p>\n<p>Change the default <code>captureRejections</code> option on all new <code>EventEmitter</code> objects.</p>"
        },
        {
          "textRaw": "events.captureRejectionSymbol",
          "name": "captureRejectionSymbol",
          "meta": {
            "added": [
              "v12.16.0"
            ],
            "changes": []
          },
          "stability": 1,
          "stabilityText": "captureRejections is experimental.",
          "desc": "<p>Value: <code>Symbol.for('nodejs.rejection')</code></p>\n<p>See how to write a custom <a href=\"events.html#events_emitter_symbol_for_nodejs_rejection_err_eventname_args\">rejection handler</a>.</p>"
        }
      ]
    },
    {
      "textRaw": "File system",
      "name": "fs",
      "introduced_in": "v0.10.0",
      "stability": 2,
      "stabilityText": "Stable",
      "desc": "<p>The <code>fs</code> module provides an API for interacting with the file system in a\nmanner closely modeled around standard POSIX functions.</p>\n<p>To use this module:</p>\n<pre><code class=\"language-js\">const fs = require('fs');\n</code></pre>\n<p>All file system operations have synchronous and asynchronous forms.</p>\n<p>The asynchronous form always takes a completion callback as its last argument.\nThe arguments passed to the completion callback depend on the method, but the\nfirst argument is always reserved for an exception. If the operation was\ncompleted successfully, then the first argument will be <code>null</code> or <code>undefined</code>.</p>\n<pre><code class=\"language-js\">const fs = require('fs');\n\nfs.unlink('/tmp/hello', (err) => {\n  if (err) throw err;\n  console.log('successfully deleted /tmp/hello');\n});\n</code></pre>\n<p>Exceptions that occur using synchronous operations are thrown immediately and\nmay be handled using <code>try…catch</code>, or may be allowed to bubble up.</p>\n<pre><code class=\"language-js\">const fs = require('fs');\n\ntry {\n  fs.unlinkSync('/tmp/hello');\n  console.log('successfully deleted /tmp/hello');\n} catch (err) {\n  // handle the error\n}\n</code></pre>\n<p>There is no guaranteed ordering when using asynchronous methods. So the\nfollowing is prone to error because the <code>fs.stat()</code> operation may complete\nbefore the <code>fs.rename()</code> operation:</p>\n<pre><code class=\"language-js\">fs.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>To correctly order the operations, move the <code>fs.stat()</code> call into the callback\nof the <code>fs.rename()</code> operation:</p>\n<pre><code class=\"language-js\">fs.rename('/tmp/hello', '/tmp/world', (err) => {\n  if (err) throw err;\n  fs.stat('/tmp/world', (err, stats) => {\n    if (err) throw err;\n    console.log(`stats: ${JSON.stringify(stats)}`);\n  });\n});\n</code></pre>\n<p>In busy processes, use the asynchronous versions of these calls. The synchronous\nversions will block the entire process until they complete, halting all\nconnections.</p>\n<p>While it is not recommended, most fs functions allow the callback argument to\nbe omitted, in which case a default callback is used that rethrows errors. To\nget a trace to the original call site, set the <code>NODE_DEBUG</code> environment\nvariable:</p>\n<p>Omitting the callback function on asynchronous fs functions is deprecated and\nmay result in an error being thrown in the future.</p>\n<pre><code class=\"language-console\">$ cat script.js\nfunction bad() {\n  require('fs').readFile('/');\n}\nbad();\n\n$ env NODE_DEBUG=fs node script.js\nfs.js:88\n        throw backtrace;\n        ^\nError: EISDIR: illegal operation on a directory, read\n    &#x3C;stack trace.>\n</code></pre>",
      "modules": [
        {
          "textRaw": "File paths",
          "name": "file_paths",
          "desc": "<p>Most <code>fs</code> operations accept filepaths that may be specified in the form of\na string, a <a href=\"buffer.html#buffer_buffer\"><code>Buffer</code></a>, or a <a href=\"url.html#url_the_whatwg_url_api\"><code>URL</code></a> object using the <code>file:</code> protocol.</p>\n<p>String form 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 specified by <code>process.cwd()</code>.</p>\n<p>Example using an absolute path on POSIX:</p>\n<pre><code class=\"language-js\">const fs = require('fs');\n\nfs.open('/open/some/file.txt', 'r', (err, fd) => {\n  if (err) throw err;\n  fs.close(fd, (err) => {\n    if (err) throw err;\n  });\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-js\">fs.open('file.txt', 'r', (err, fd) => {\n  if (err) throw err;\n  fs.close(fd, (err) => {\n    if (err) throw err;\n  });\n});\n</code></pre>\n<p>Paths specified using a <a href=\"buffer.html#buffer_buffer\"><code>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, <code>Buffer</code> paths may\nbe relative or absolute:</p>\n<p>Example using an absolute path on POSIX:</p>\n<pre><code class=\"language-js\">fs.open(Buffer.from('/open/some/file.txt'), 'r', (err, fd) => {\n  if (err) throw err;\n  fs.close(fd, (err) => {\n    if (err) throw err;\n  });\n});\n</code></pre>\n<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>",
          "modules": [
            {
              "textRaw": "URL object support",
              "name": "url_object_support",
              "meta": {
                "added": [
                  "v7.6.0"
                ],
                "changes": []
              },
              "desc": "<p>For most <code>fs</code> module functions, the <code>path</code> or <code>filename</code> argument may be passed\nas a WHATWG <a href=\"url.html#url_the_whatwg_url_api\"><code>URL</code></a> object. Only <a href=\"url.html#url_the_whatwg_url_api\"><code>URL</code></a> objects using the <code>file:</code> protocol\nare supported.</p>\n<pre><code class=\"language-js\">const fs = require('fs');\nconst fileUrl = new URL('file:///tmp/hello');\n\nfs.readFileSync(fileUrl);\n</code></pre>\n<p><code>file:</code> URLs are always absolute paths.</p>\n<p>Using WHATWG <a href=\"url.html#url_the_whatwg_url_api\"><code>URL</code></a> objects might introduce platform-specific behaviors.</p>\n<p>On Windows, <code>file:</code> URLs with a host name convert to UNC paths, while <code>file:</code>\nURLs with drive letters convert to local absolute paths. <code>file:</code> URLs without a\nhost name nor a drive letter will result in a throw:</p>\n<pre><code class=\"language-js\">// 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\nfs.readFileSync(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\nfs.readFileSync(new URL('file:///C:/tmp/hello'));\n\n// - WHATWG file URLs without hostname must have a drive letters\nfs.readFileSync(new URL('file:///notdriveletter/p/a/t/h/file'));\nfs.readFileSync(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> URLs with drive letters must use <code>:</code> as a separator just after\nthe drive letter. Using another separator will result in a throw.</p>\n<p>On all other platforms, <code>file:</code> URLs with a host name are unsupported and will\nresult in a throw:</p>\n<pre><code class=\"language-js\">// On other platforms:\n\n// - WHATWG file URLs with hostname are unsupported\n// file://hostname/p/a/t/h/file => throw!\nfs.readFileSync(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\nfs.readFileSync(new URL('file:///tmp/hello'));\n</code></pre>\n<p>A <code>file:</code> URL having encoded slash characters will result in a throw on all\nplatforms:</p>\n<pre><code class=\"language-js\">// On Windows\nfs.readFileSync(new URL('file:///C:/p/a/t/h/%2F'));\nfs.readFileSync(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\nfs.readFileSync(new URL('file:///p/a/t/h/%2F'));\nfs.readFileSync(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> URLs having encoded backslash will result in a throw:</p>\n<pre><code class=\"language-js\">// On Windows\nfs.readFileSync(new URL('file:///C:/path/%5C'));\nfs.readFileSync(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>",
              "type": "module",
              "displayName": "URL object support"
            }
          ],
          "type": "module",
          "displayName": "File paths"
        },
        {
          "textRaw": "File descriptors",
          "name": "file_descriptors",
          "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\nspecific differences between operating systems and assigns all open files a\nnumeric file descriptor.</p>\n<p>The <code>fs.open()</code> method is used to allocate a new file descriptor. Once\nallocated, the file descriptor may be used to read data from, write data to,\nor request information about the file.</p>\n<pre><code class=\"language-js\">fs.open('/open/some/file.txt', 'r', (err, fd) => {\n  if (err) throw err;\n  fs.fstat(fd, (err, stat) => {\n    if (err) throw err;\n    // use stat\n\n    // always close the file descriptor!\n    fs.close(fd, (err) => {\n      if (err) throw err;\n    });\n  });\n});\n</code></pre>\n<p>Most 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>",
          "type": "module",
          "displayName": "File descriptors"
        },
        {
          "textRaw": "Threadpool usage",
          "name": "threadpool_usage",
          "desc": "<p>All file system APIs except <code>fs.FSWatcher()</code> and those that are explicitly\nsynchronous use libuv's threadpool, which can have surprising and negative\nperformance implications for some applications. See the\n<a href=\"cli.html#cli_uv_threadpool_size_size\"><code>UV_THREADPOOL_SIZE</code></a> documentation for more information.</p>",
          "type": "module",
          "displayName": "Threadpool usage"
        },
        {
          "textRaw": "`fs` Promises API",
          "name": "`fs`_promises_api",
          "desc": "<p>The <code>fs.promises</code> API provides an alternative set of asynchronous file system\nmethods that return <code>Promise</code> objects rather than using callbacks. The\nAPI is accessible via <code>require('fs').promises</code>.</p>",
          "classes": [
            {
              "textRaw": "Class: `FileHandle`",
              "type": "class",
              "name": "FileHandle",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "desc": "<p>A <code>FileHandle</code> object is a wrapper for a numeric file descriptor.\nInstances of <code>FileHandle</code> are distinct from numeric file descriptors\nin that they provide an object oriented API for working with files.</p>\n<p>If a <code>FileHandle</code> is not closed using the\n<code>filehandle.close()</code> method, it might automatically close the file descriptor\nand will emit a process warning, thereby helping to prevent memory leaks.\nPlease do not rely on this behavior because it is unreliable and\nthe file may not be closed. Instead, always explicitly close <code>FileHandle</code>s.\nNode.js may change this behavior in the future.</p>\n<p>Instances of the <code>FileHandle</code> object are created internally by the\n<code>fsPromises.open()</code> method.</p>\n<p>Unlike the callback-based API (<code>fs.fstat()</code>, <code>fs.fchown()</code>, <code>fs.fchmod()</code>, and\nso on), a numeric file descriptor is not used by the promise-based API. Instead,\nthe promise-based API uses the <code>FileHandle</code> class in order to help avoid\naccidental leaking of unclosed file descriptors after a <code>Promise</code> is resolved or\nrejected.</p>",
              "methods": [
                {
                  "textRaw": "`filehandle.appendFile(data, options)`",
                  "type": "method",
                  "name": "appendFile",
                  "meta": {
                    "added": [
                      "v10.0.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "return": {
                        "textRaw": "Returns: {Promise}",
                        "name": "return",
                        "type": "Promise"
                      },
                      "params": [
                        {
                          "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'`"
                            }
                          ]
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Alias of <a href=\"fs.html#fs_filehandle_writefile_data_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=\"fs.html#fs_fspromises_open_path_flags_mode\"><code>fsPromises.open()</code></a>. Therefore, this is equivalent to\n<a href=\"fs.html#fs_filehandle_writefile_data_options\"><code>filehandle.writeFile()</code></a>.</p>"
                },
                {
                  "textRaw": "`filehandle.chmod(mode)`",
                  "type": "method",
                  "name": "chmod",
                  "meta": {
                    "added": [
                      "v10.0.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "return": {
                        "textRaw": "Returns: {Promise}",
                        "name": "return",
                        "type": "Promise"
                      },
                      "params": [
                        {
                          "textRaw": "`mode` {integer}",
                          "name": "mode",
                          "type": "integer"
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Modifies the permissions on the file. The <code>Promise</code> is resolved with no\narguments upon success.</p>"
                },
                {
                  "textRaw": "`filehandle.chown(uid, gid)`",
                  "type": "method",
                  "name": "chown",
                  "meta": {
                    "added": [
                      "v10.0.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "return": {
                        "textRaw": "Returns: {Promise}",
                        "name": "return",
                        "type": "Promise"
                      },
                      "params": [
                        {
                          "textRaw": "`uid` {integer}",
                          "name": "uid",
                          "type": "integer"
                        },
                        {
                          "textRaw": "`gid` {integer}",
                          "name": "gid",
                          "type": "integer"
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Changes the ownership of the file then resolves the <code>Promise</code> with no arguments\nupon success.</p>"
                },
                {
                  "textRaw": "`filehandle.close()`",
                  "type": "method",
                  "name": "close",
                  "meta": {
                    "added": [
                      "v10.0.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "return": {
                        "textRaw": "Returns: {Promise} A `Promise` that will be resolved once the underlying file descriptor is closed, or will be rejected if an error occurs while closing.",
                        "name": "return",
                        "type": "Promise",
                        "desc": "A `Promise` that will be resolved once the underlying file descriptor is closed, or will be rejected if an error occurs while closing."
                      },
                      "params": []
                    }
                  ],
                  "desc": "<p>Closes the file descriptor.</p>\n<pre><code class=\"language-js\">const fsPromises = require('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>"
                },
                {
                  "textRaw": "`filehandle.datasync()`",
                  "type": "method",
                  "name": "datasync",
                  "meta": {
                    "added": [
                      "v10.0.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "return": {
                        "textRaw": "Returns: {Promise}",
                        "name": "return",
                        "type": "Promise"
                      },
                      "params": []
                    }
                  ],
                  "desc": "<p>Asynchronous <a href=\"http://man7.org/linux/man-pages/man2/fdatasync.2.html\"><code>fdatasync(2)</code></a>. The <code>Promise</code> is resolved with no arguments upon\nsuccess.</p>"
                },
                {
                  "textRaw": "`filehandle.read(buffer, offset, length, position)`",
                  "type": "method",
                  "name": "read",
                  "meta": {
                    "added": [
                      "v10.0.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "return": {
                        "textRaw": "Returns: {Promise}",
                        "name": "return",
                        "type": "Promise"
                      },
                      "params": [
                        {
                          "textRaw": "`buffer` {Buffer|Uint8Array}",
                          "name": "buffer",
                          "type": "Buffer|Uint8Array"
                        },
                        {
                          "textRaw": "`offset` {integer}",
                          "name": "offset",
                          "type": "integer"
                        },
                        {
                          "textRaw": "`length` {integer}",
                          "name": "length",
                          "type": "integer"
                        },
                        {
                          "textRaw": "`position` {integer}",
                          "name": "position",
                          "type": "integer"
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Read data from the file.</p>\n<p><code>buffer</code> is the buffer that the data will be written to.</p>\n<p><code>offset</code> is the offset in the buffer to start writing at.</p>\n<p><code>length</code> is an integer specifying the number of bytes to read.</p>\n<p><code>position</code> is an argument specifying where to begin reading from in the file.\nIf <code>position</code> is <code>null</code>, data will be read from the current file position,\nand the file position will be updated.\nIf <code>position</code> is an integer, the file position will remain unchanged.</p>\n<p>Following successful read, the <code>Promise</code> is resolved with an object with a\n<code>bytesRead</code> property specifying the number of bytes read, and a <code>buffer</code>\nproperty that is a reference to the passed in <code>buffer</code> argument.</p>"
                },
                {
                  "textRaw": "`filehandle.read(options)`",
                  "type": "method",
                  "name": "read",
                  "meta": {
                    "added": [
                      "v12.17.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "return": {
                        "textRaw": "Returns: {Promise}",
                        "name": "return",
                        "type": "Promise"
                      },
                      "params": [
                        {
                          "textRaw": "`options` {Object}",
                          "name": "options",
                          "type": "Object",
                          "options": [
                            {
                              "textRaw": "`buffer` {Buffer|Uint8Array} **Default:** `Buffer.alloc(16384)`",
                              "name": "buffer",
                              "type": "Buffer|Uint8Array",
                              "default": "`Buffer.alloc(16384)`"
                            },
                            {
                              "textRaw": "`offset` {integer} **Default:** `0`",
                              "name": "offset",
                              "type": "integer",
                              "default": "`0`"
                            },
                            {
                              "textRaw": "`length` {integer} **Default:** `buffer.length`",
                              "name": "length",
                              "type": "integer",
                              "default": "`buffer.length`"
                            },
                            {
                              "textRaw": "`position` {integer} **Default:** `null`",
                              "name": "position",
                              "type": "integer",
                              "default": "`null`"
                            }
                          ]
                        }
                      ]
                    }
                  ]
                },
                {
                  "textRaw": "`filehandle.readFile(options)`",
                  "type": "method",
                  "name": "readFile",
                  "meta": {
                    "added": [
                      "v10.0.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "return": {
                        "textRaw": "Returns: {Promise}",
                        "name": "return",
                        "type": "Promise"
                      },
                      "params": [
                        {
                          "textRaw": "`options` {Object|string}",
                          "name": "options",
                          "type": "Object|string",
                          "options": [
                            {
                              "textRaw": "`encoding` {string|null} **Default:** `null`",
                              "name": "encoding",
                              "type": "string|null",
                              "default": "`null`"
                            }
                          ]
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Asynchronously reads the entire contents of a file.</p>\n<p>The <code>Promise</code> is resolved with the contents of the file. If no encoding is\nspecified (using <code>options.encoding</code>), the data is returned as a <code>Buffer</code>\nobject. 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>The <code>FileHandle</code> 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.readv(buffers[, position])`",
                  "type": "method",
                  "name": "readv",
                  "meta": {
                    "added": [
                      "v12.17.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "return": {
                        "textRaw": "Returns: {Promise}",
                        "name": "return",
                        "type": "Promise"
                      },
                      "params": [
                        {
                          "textRaw": "`buffers` {ArrayBufferView[]}",
                          "name": "buffers",
                          "type": "ArrayBufferView[]"
                        },
                        {
                          "textRaw": "`position` {integer}",
                          "name": "position",
                          "type": "integer"
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Read from a file and write to an array of <code>ArrayBufferView</code>s</p>\n<p>The <code>Promise</code> is resolved with an object containing a <code>bytesRead</code> property\nidentifying the number of bytes read, and a <code>buffers</code> property containing\na reference to the <code>buffers</code> input.</p>\n<p><code>position</code> is the offset from the beginning of the file where this data\nshould be read from. If <code>typeof position !== 'number'</code>, the data will be read\nfrom the current position.</p>"
                },
                {
                  "textRaw": "`filehandle.stat([options])`",
                  "type": "method",
                  "name": "stat",
                  "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": [
                    {
                      "return": {
                        "textRaw": "Returns: {Promise}",
                        "name": "return",
                        "type": "Promise"
                      },
                      "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`."
                            }
                          ]
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Retrieves the <a href=\"fs.html#fs_class_fs_stats\"><code>fs.Stats</code></a> for the file.</p>"
                },
                {
                  "textRaw": "`filehandle.sync()`",
                  "type": "method",
                  "name": "sync",
                  "meta": {
                    "added": [
                      "v10.0.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "return": {
                        "textRaw": "Returns: {Promise}",
                        "name": "return",
                        "type": "Promise"
                      },
                      "params": []
                    }
                  ],
                  "desc": "<p>Asynchronous <a href=\"http://man7.org/linux/man-pages/man2/fsync.2.html\"><code>fsync(2)</code></a>. The <code>Promise</code> is resolved with no arguments upon\nsuccess.</p>"
                },
                {
                  "textRaw": "`filehandle.truncate(len)`",
                  "type": "method",
                  "name": "truncate",
                  "meta": {
                    "added": [
                      "v10.0.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "return": {
                        "textRaw": "Returns: {Promise}",
                        "name": "return",
                        "type": "Promise"
                      },
                      "params": [
                        {
                          "textRaw": "`len` {integer} **Default:** `0`",
                          "name": "len",
                          "type": "integer",
                          "default": "`0`"
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Truncates the file then resolves the <code>Promise</code> with no arguments upon success.</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>For example, the following program retains only the first four bytes of the\nfile:</p>\n<pre><code class=\"language-js\">const fs = require('fs');\nconst fsPromises = fs.promises;\n\nconsole.log(fs.readFileSync('temp.txt', 'utf8'));\n// Prints: Node.js\n\nasync function doTruncate() {\n  let filehandle = null;\n  try {\n    filehandle = await fsPromises.open('temp.txt', 'r+');\n    await filehandle.truncate(4);\n  } finally {\n    if (filehandle) {\n      // Close the file if it is opened.\n      await filehandle.close();\n    }\n  }\n  console.log(fs.readFileSync('temp.txt', 'utf8'));  // Prints: Node\n}\n\ndoTruncate().catch(console.error);\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<pre><code class=\"language-js\">const fs = require('fs');\nconst fsPromises = fs.promises;\n\nconsole.log(fs.readFileSync('temp.txt', 'utf8'));\n// Prints: Node.js\n\nasync function doTruncate() {\n  let filehandle = null;\n  try {\n    filehandle = await fsPromises.open('temp.txt', 'r+');\n    await filehandle.truncate(10);\n  } finally {\n    if (filehandle) {\n      // Close the file if it is opened.\n      await filehandle.close();\n    }\n  }\n  console.log(fs.readFileSync('temp.txt', 'utf8'));  // Prints Node.js\\0\\0\\0\n}\n\ndoTruncate().catch(console.error);\n</code></pre>\n<p>The last three bytes are null bytes (<code>'\\0'</code>), to compensate the over-truncation.</p>"
                },
                {
                  "textRaw": "`filehandle.utimes(atime, mtime)`",
                  "type": "method",
                  "name": "utimes",
                  "meta": {
                    "added": [
                      "v10.0.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "return": {
                        "textRaw": "Returns: {Promise}",
                        "name": "return",
                        "type": "Promise"
                      },
                      "params": [
                        {
                          "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 object referenced by the <code>FileHandle</code>\nthen resolves the <code>Promise</code> with no arguments upon success.</p>\n<p>This function does not work on AIX versions before 7.1, it will resolve the\n<code>Promise</code> with an error using code <code>UV_ENOSYS</code>.</p>"
                },
                {
                  "textRaw": "`filehandle.write(buffer[, offset[, length[, position]]])`",
                  "type": "method",
                  "name": "write",
                  "meta": {
                    "added": [
                      "v10.0.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "return": {
                        "textRaw": "Returns: {Promise}",
                        "name": "return",
                        "type": "Promise"
                      },
                      "params": [
                        {
                          "textRaw": "`buffer` {Buffer|Uint8Array}",
                          "name": "buffer",
                          "type": "Buffer|Uint8Array"
                        },
                        {
                          "textRaw": "`offset` {integer}",
                          "name": "offset",
                          "type": "integer"
                        },
                        {
                          "textRaw": "`length` {integer}",
                          "name": "length",
                          "type": "integer"
                        },
                        {
                          "textRaw": "`position` {integer}",
                          "name": "position",
                          "type": "integer"
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Write <code>buffer</code> to the file.</p>\n<p>The <code>Promise</code> is resolved with an object containing a <code>bytesWritten</code> property\nidentifying the number of bytes written, and a <code>buffer</code> property containing\na reference to the <code>buffer</code> written.</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>It is unsafe to use <code>filehandle.write()</code> multiple times on the same file\nwithout waiting for the <code>Promise</code> to be resolved (or rejected). For this\nscenario, use <a href=\"fs.html#fs_fs_createwritestream_path_options\"><code>fs.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(string[, position[, encoding]])`",
                  "type": "method",
                  "name": "write",
                  "meta": {
                    "added": [
                      "v10.0.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "return": {
                        "textRaw": "Returns: {Promise}",
                        "name": "return",
                        "type": "Promise"
                      },
                      "params": [
                        {
                          "textRaw": "`string` {string}",
                          "name": "string",
                          "type": "string"
                        },
                        {
                          "textRaw": "`position` {integer}",
                          "name": "position",
                          "type": "integer"
                        },
                        {
                          "textRaw": "`encoding` {string} **Default:** `'utf8'`",
                          "name": "encoding",
                          "type": "string",
                          "default": "`'utf8'`"
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Write <code>string</code> to the file. If <code>string</code> is not a string, then\nthe value will be coerced to one.</p>\n<p>The <code>Promise</code> is resolved with an object containing a <code>bytesWritten</code> property\nidentifying the number of bytes written, and a <code>buffer</code> property containing\na reference to the <code>string</code> written.</p>\n<p><code>position</code> refers to the offset from the beginning of the file where this data\nshould be written. If the type of <code>position</code> is not a <code>number</code> the data\nwill be written at the 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>It is unsafe to use <code>filehandle.write()</code> multiple times on the same file\nwithout waiting for the <code>Promise</code> to be resolved (or rejected). For this\nscenario, use <a href=\"fs.html#fs_fs_createwritestream_path_options\"><code>fs.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)`",
                  "type": "method",
                  "name": "writeFile",
                  "meta": {
                    "added": [
                      "v10.0.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "return": {
                        "textRaw": "Returns: {Promise}",
                        "name": "return",
                        "type": "Promise"
                      },
                      "params": [
                        {
                          "textRaw": "`data` {string|Buffer|Uint8Array}",
                          "name": "data",
                          "type": "string|Buffer|Uint8Array"
                        },
                        {
                          "textRaw": "`options` {Object|string}",
                          "name": "options",
                          "type": "Object|string",
                          "options": [
                            {
                              "textRaw": "`encoding` {string|null} **Default:** `'utf8'`",
                              "name": "encoding",
                              "type": "string|null",
                              "default": "`'utf8'`"
                            }
                          ]
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Asynchronously writes data to a file, replacing the file if it already exists.\n<code>data</code> can be a string or a buffer. The <code>Promise</code> will be resolved with no\narguments upon success.</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>FileHandle</code> 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 <code>Promise</code> to be resolved (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])`",
                  "type": "method",
                  "name": "writev",
                  "meta": {
                    "added": [
                      "v12.9.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "return": {
                        "textRaw": "Returns: {Promise}",
                        "name": "return",
                        "type": "Promise"
                      },
                      "params": [
                        {
                          "textRaw": "`buffers` {ArrayBufferView[]}",
                          "name": "buffers",
                          "type": "ArrayBufferView[]"
                        },
                        {
                          "textRaw": "`position` {integer}",
                          "name": "position",
                          "type": "integer"
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Write an array of <code>ArrayBufferView</code>s to the file.</p>\n<p>The <code>Promise</code> is resolved with an object containing a <code>bytesWritten</code> property\nidentifying the number of bytes written, and a <code>buffers</code> property containing\na reference to the <code>buffers</code> input.</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>It is unsafe to call <code>writev()</code> multiple times on the same file without waiting\nfor the previous operation to complete.</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>"
                }
              ],
              "properties": [
                {
                  "textRaw": "`fd` {number} The numeric file descriptor managed by the `FileHandle` object.",
                  "type": "number",
                  "name": "fd",
                  "meta": {
                    "added": [
                      "v10.0.0"
                    ],
                    "changes": []
                  },
                  "desc": "The numeric file descriptor managed by the `FileHandle` object."
                }
              ]
            }
          ],
          "methods": [
            {
              "textRaw": "`fsPromises.access(path[, mode])`",
              "type": "method",
              "name": "access",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Promise}",
                    "name": "return",
                    "type": "Promise"
                  },
                  "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`"
                    }
                  ]
                }
              ],
              "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. Check <a href=\"fs.html#fs_file_access_constants\">File access constants</a> for possible values\nof <code>mode</code>. It is possible to create a mask consisting of the bitwise OR of\ntwo or more values (e.g. <code>fs.constants.W_OK | fs.constants.R_OK</code>).</p>\n<p>If the accessibility check is successful, the <code>Promise</code> is resolved with no\nvalue. If any of the accessibility checks fail, the <code>Promise</code> is rejected\nwith an <code>Error</code> object. The following example checks if the file\n<code>/etc/passwd</code> can be read and written by the current process.</p>\n<pre><code class=\"language-js\">const fs = require('fs');\nconst fsPromises = fs.promises;\n\nfsPromises.access('/etc/passwd', fs.constants.R_OK | fs.constants.W_OK)\n  .then(() => console.log('can access'))\n  .catch(() => console.error('cannot access'));\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])`",
              "type": "method",
              "name": "appendFile",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Promise}",
                    "name": "return",
                    "type": "Promise"
                  },
                  "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`][]."
                        }
                      ]
                    }
                  ]
                }
              ],
              "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#buffer_buffer\"><code>Buffer</code></a>. The <code>Promise</code> will be\nresolved with no arguments upon success.</p>\n<p>If <code>options</code> is a string, then it specifies the encoding.</p>\n<p>The <code>path</code> may be specified as a <code>FileHandle</code> that has been opened\nfor appending (using <code>fsPromises.open()</code>).</p>"
            },
            {
              "textRaw": "`fsPromises.chmod(path, mode)`",
              "type": "method",
              "name": "chmod",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Promise}",
                    "name": "return",
                    "type": "Promise"
                  },
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`mode` {string|integer}",
                      "name": "mode",
                      "type": "string|integer"
                    }
                  ]
                }
              ],
              "desc": "<p>Changes the permissions of a file then resolves the <code>Promise</code> with no\narguments upon succces.</p>"
            },
            {
              "textRaw": "`fsPromises.chown(path, uid, gid)`",
              "type": "method",
              "name": "chown",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Promise}",
                    "name": "return",
                    "type": "Promise"
                  },
                  "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>Changes the ownership of a file then resolves the <code>Promise</code> with no arguments\nupon success.</p>"
            },
            {
              "textRaw": "`fsPromises.copyFile(src, dest[, flags])`",
              "type": "method",
              "name": "copyFile",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Promise}",
                    "name": "return",
                    "type": "Promise"
                  },
                  "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": "`flags` {number} modifiers for copy operation. **Default:** `0`.",
                      "name": "flags",
                      "type": "number",
                      "default": "`0`",
                      "desc": "modifiers for copy operation."
                    }
                  ]
                }
              ],
              "desc": "<p>Asynchronously copies <code>src</code> to <code>dest</code>. By default, <code>dest</code> is overwritten if it\nalready exists. The <code>Promise</code> will be resolved with no arguments upon success.</p>\n<p>Node.js makes no guarantees about the atomicity of the copy operation. If an\nerror occurs after the destination file has been opened for writing, Node.js\nwill attempt to remove the destination.</p>\n<p><code>flags</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 copy-on-write,\nthen the operation will fail.</li>\n</ul>\n<pre><code class=\"language-js\">const fsPromises = require('fs').promises;\n\n// destination.txt will be created or overwritten by default.\nfsPromises.copyFile('source.txt', 'destination.txt')\n  .then(() => console.log('source.txt was copied to destination.txt'))\n  .catch(() => console.log('The file could not be copied'));\n</code></pre>\n<p>If the third argument is a number, then it specifies <code>flags</code>:</p>\n<pre><code class=\"language-js\">const fs = require('fs');\nconst fsPromises = fs.promises;\nconst { COPYFILE_EXCL } = fs.constants;\n\n// By using COPYFILE_EXCL, the operation will fail if destination.txt exists.\nfsPromises.copyFile('source.txt', 'destination.txt', COPYFILE_EXCL)\n  .then(() => console.log('source.txt was copied to destination.txt'))\n  .catch(() => console.log('The file could not be copied'));\n</code></pre>"
            },
            {
              "textRaw": "`fsPromises.lchmod(path, mode)`",
              "type": "method",
              "name": "lchmod",
              "meta": {
                "deprecated": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Promise}",
                    "name": "return",
                    "type": "Promise"
                  },
                  "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 then resolves the <code>Promise</code> with\nno arguments upon success. This method is only implemented on macOS.</p>"
            },
            {
              "textRaw": "`fsPromises.lchown(path, uid, gid)`",
              "type": "method",
              "name": "lchown",
              "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": [
                {
                  "return": {
                    "textRaw": "Returns: {Promise}",
                    "name": "return",
                    "type": "Promise"
                  },
                  "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>Changes the ownership on a symbolic link then resolves the <code>Promise</code> with\nno arguments upon success.</p>"
            },
            {
              "textRaw": "`fsPromises.link(existingPath, newPath)`",
              "type": "method",
              "name": "link",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Promise}",
                    "name": "return",
                    "type": "Promise"
                  },
                  "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>Asynchronous <a href=\"http://man7.org/linux/man-pages/man2/link.2.html\"><code>link(2)</code></a>. The <code>Promise</code> is resolved with no arguments upon success.</p>"
            },
            {
              "textRaw": "`fsPromises.lstat(path[, options])`",
              "type": "method",
              "name": "lstat",
              "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": [
                {
                  "return": {
                    "textRaw": "Returns: {Promise}",
                    "name": "return",
                    "type": "Promise"
                  },
                  "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`."
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Asynchronous <a href=\"http://man7.org/linux/man-pages/man2/lstat.2.html\"><code>lstat(2)</code></a>. The <code>Promise</code> is resolved with the <a href=\"fs.html#fs_class_fs_stats\"><code>fs.Stats</code></a> object\nfor the given symbolic link <code>path</code>.</p>"
            },
            {
              "textRaw": "`fsPromises.mkdir(path[, options])`",
              "type": "method",
              "name": "mkdir",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Promise}",
                    "name": "return",
                    "type": "Promise"
                  },
                  "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."
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Asynchronously creates a directory then resolves the <code>Promise</code> with either no\narguments, or the first directory path created if <code>recursive</code> is <code>true</code>.</p>\n<p>The optional <code>options</code> argument can be an integer specifying mode (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>"
            },
            {
              "textRaw": "`fsPromises.mkdtemp(prefix[, options])`",
              "type": "method",
              "name": "mkdtemp",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Promise}",
                    "name": "return",
                    "type": "Promise"
                  },
                  "params": [
                    {
                      "textRaw": "`prefix` {string}",
                      "name": "prefix",
                      "type": "string"
                    },
                    {
                      "textRaw": "`options` {string|Object}",
                      "name": "options",
                      "type": "string|Object",
                      "options": [
                        {
                          "textRaw": "`encoding` {string} **Default:** `'utf8'`",
                          "name": "encoding",
                          "type": "string",
                          "default": "`'utf8'`"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Creates a unique temporary directory and resolves the <code>Promise</code> with the created\ndirectory path. A unique directory name is generated by appending six random\ncharacters to the end of the provided <code>prefix</code>. 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 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-js\">fsPromises.mkdtemp(path.join(os.tmpdir(), 'foo-'))\n  .catch(console.error);\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('path').sep</code>).</p>"
            },
            {
              "textRaw": "`fsPromises.open(path, flags[, mode])`",
              "type": "method",
              "name": "open",
              "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": [
                {
                  "return": {
                    "textRaw": "Returns: {Promise}",
                    "name": "return",
                    "type": "Promise"
                  },
                  "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} **Default:** `0o666` (readable and writable)",
                      "name": "mode",
                      "type": "string|integer",
                      "default": "`0o666` (readable and writable)"
                    }
                  ]
                }
              ],
              "desc": "<p>Asynchronous file open that returns a <code>Promise</code> that, when resolved, yields a\n<code>FileHandle</code> object. See <a href=\"http://man7.org/linux/man-pages/man2/open.2.html\"><code>open(2)</code></a>.</p>\n<p><code>mode</code> sets the file mode (permission and sticky bits), but only if the file was\ncreated.</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])`",
              "type": "method",
              "name": "opendir",
              "meta": {
                "added": [
                  "v12.12.0"
                ],
                "changes": [
                  {
                    "version": "v12.16.0",
                    "pr-url": "https://github.com/nodejs/node/pull/30114",
                    "description": "The `bufferSize` option was introduced."
                  }
                ]
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Promise} containing {fs.Dir}",
                    "name": "return",
                    "type": "Promise",
                    "desc": "containing {fs.Dir}"
                  },
                  "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."
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Asynchronously 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#fs_class_fs_dir\"><code>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-js\">const fs = require('fs');\n\nasync function print(path) {\n  const dir = await fs.promises.opendir(path);\n  for await (const dirent of dir) {\n    console.log(dirent.name);\n  }\n}\nprint('./').catch(console.error);\n</code></pre>"
            },
            {
              "textRaw": "`fsPromises.readdir(path[, options])`",
              "type": "method",
              "name": "readdir",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": [
                  {
                    "version": "v10.11.0",
                    "pr-url": "https://github.com/nodejs/node/pull/22020",
                    "description": "New option `withFileTypes` was added."
                  }
                ]
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Promise}",
                    "name": "return",
                    "type": "Promise"
                  },
                  "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`"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Reads the contents of a directory then resolves the <code>Promise</code> with an array\nof the names of the files in the directory excluding <code>'.'</code> and <code>'..'</code>.</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 <code>Buffer</code> objects.</p>\n<p>If <code>options.withFileTypes</code> is set to <code>true</code>, the resolved array will contain\n<a href=\"fs.html#fs_class_fs_dirent\"><code>fs.Dirent</code></a> objects.</p>\n<pre><code class=\"language-js\">const fs = require('fs');\n\nasync function print(path) {\n  const files = await fs.promises.readdir(path);\n  for (const file of files) {\n    console.log(file);\n  }\n}\nprint('./').catch(console.error);\n</code></pre>"
            },
            {
              "textRaw": "`fsPromises.readFile(path[, options])`",
              "type": "method",
              "name": "readFile",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Promise}",
                    "name": "return",
                    "type": "Promise"
                  },
                  "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`][]."
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Asynchronously reads the entire contents of a file.</p>\n<p>The <code>Promise</code> is resolved with the contents of the file. If no encoding is\nspecified (using <code>options.encoding</code>), the data is returned as a <code>Buffer</code>\nobject. 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>Any specified <code>FileHandle</code> has to support reading.</p>"
            },
            {
              "textRaw": "`fsPromises.readlink(path[, options])`",
              "type": "method",
              "name": "readlink",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Promise}",
                    "name": "return",
                    "type": "Promise"
                  },
                  "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'`"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Asynchronous <a href=\"http://man7.org/linux/man-pages/man2/readlink.2.html\"><code>readlink(2)</code></a>. The <code>Promise</code> is resolved with the <code>linkString</code> upon\nsuccess.</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 <code>Buffer</code> object.</p>"
            },
            {
              "textRaw": "`fsPromises.realpath(path[, options])`",
              "type": "method",
              "name": "realpath",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Promise}",
                    "name": "return",
                    "type": "Promise"
                  },
                  "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'`"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Determines the actual location of <code>path</code> using the same semantics as the\n<code>fs.realpath.native()</code> function then resolves the <code>Promise</code> with the resolved\npath.</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 <code>Buffer</code> 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)`",
              "type": "method",
              "name": "rename",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Promise}",
                    "name": "return",
                    "type": "Promise"
                  },
                  "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 <code>oldPath</code> to <code>newPath</code> and resolves the <code>Promise</code> with no arguments\nupon success.</p>"
            },
            {
              "textRaw": "`fsPromises.rmdir(path[, options])`",
              "type": "method",
              "name": "rmdir",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": [
                  {
                    "version": "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."
                  }
                ]
              },
              "stability": 1,
              "stabilityText": "Recursive removal is experimental.",
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Promise}",
                    "name": "return",
                    "type": "Promise"
                  },
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "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` ms 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` ms 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, errors are not reported if `path` does not exist, and operations are retried on failure. **Default:** `false`.",
                          "name": "recursive",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "If `true`, perform a recursive directory removal. In recursive mode, errors are not reported if `path` does not exist, and 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`."
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Removes the directory identified by <code>path</code> then resolves the <code>Promise</code> with\nno arguments upon success.</p>\n<p>Using <code>fsPromises.rmdir()</code> on a file (not a directory) results in the\n<code>Promise</code> being rejected with an <code>ENOENT</code> error on Windows and an <code>ENOTDIR</code>\nerror on POSIX.</p>"
            },
            {
              "textRaw": "`fsPromises.stat(path[, options])`",
              "type": "method",
              "name": "stat",
              "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": [
                {
                  "return": {
                    "textRaw": "Returns: {Promise}",
                    "name": "return",
                    "type": "Promise"
                  },
                  "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`."
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>The <code>Promise</code> is resolved with the <a href=\"fs.html#fs_class_fs_stats\"><code>fs.Stats</code></a> object for the given <code>path</code>.</p>"
            },
            {
              "textRaw": "`fsPromises.symlink(target, path[, type])`",
              "type": "method",
              "name": "symlink",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Promise}",
                    "name": "return",
                    "type": "Promise"
                  },
                  "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} **Default:** `'file'`",
                      "name": "type",
                      "type": "string",
                      "default": "`'file'`"
                    }
                  ]
                }
              ],
              "desc": "<p>Creates a symbolic link then resolves the <code>Promise</code> with no arguments upon\nsuccess.</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>. Windows junction points require the destination path\nto be absolute. When using <code>'junction'</code>, the <code>target</code> argument will\nautomatically be normalized to absolute path.</p>"
            },
            {
              "textRaw": "`fsPromises.truncate(path[, len])`",
              "type": "method",
              "name": "truncate",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Promise}",
                    "name": "return",
                    "type": "Promise"
                  },
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`len` {integer} **Default:** `0`",
                      "name": "len",
                      "type": "integer",
                      "default": "`0`"
                    }
                  ]
                }
              ],
              "desc": "<p>Truncates the <code>path</code> then resolves the <code>Promise</code> with no arguments upon\nsuccess. The <code>path</code> <em>must</em> be a string or <code>Buffer</code>.</p>"
            },
            {
              "textRaw": "`fsPromises.unlink(path)`",
              "type": "method",
              "name": "unlink",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Promise}",
                    "name": "return",
                    "type": "Promise"
                  },
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    }
                  ]
                }
              ],
              "desc": "<p>Asynchronous <a href=\"http://man7.org/linux/man-pages/man2/unlink.2.html\"><code>unlink(2)</code></a>. The <code>Promise</code> is resolved with no arguments upon\nsuccess.</p>"
            },
            {
              "textRaw": "`fsPromises.utimes(path, atime, mtime)`",
              "type": "method",
              "name": "utimes",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Promise}",
                    "name": "return",
                    "type": "Promise"
                  },
                  "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 object referenced by <code>path</code> then\nresolves the <code>Promise</code> with no arguments upon success.</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.writeFile(file, data[, options])`",
              "type": "method",
              "name": "writeFile",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Promise}",
                    "name": "return",
                    "type": "Promise"
                  },
                  "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|Uint8Array}",
                      "name": "data",
                      "type": "string|Buffer|Uint8Array"
                    },
                    {
                      "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`][]."
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Asynchronously writes data to a file, replacing the file if it already exists.\n<code>data</code> can be a string or a buffer. The <code>Promise</code> will be resolved with no\narguments upon success.</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>Any specified <code>FileHandle</code> 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 <code>Promise</code> to be resolved (or rejected).</p>"
            }
          ],
          "type": "module",
          "displayName": "`fs` Promises API"
        },
        {
          "textRaw": "FS constants",
          "name": "fs_constants",
          "desc": "<p>The following constants are exported by <code>fs.constants</code>.</p>\n<p>Not every constant will be available on every operating system.</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-js\">const fs = require('fs');\n\nconst {\n  O_RDWR,\n  O_CREAT,\n  O_EXCL\n} = fs.constants;\n\nfs.open('/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",
              "desc": "<p>The following constants are meant for use with <a href=\"fs.html#fs_fs_access_path_mode_callback\"><code>fs.access()</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>",
              "type": "module",
              "displayName": "File access constants"
            },
            {
              "textRaw": "File copy constants",
              "name": "file_copy_constants",
              "desc": "<p>The following constants are meant for use with <a href=\"fs.html#fs_fs_copyfile_src_dest_flags_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>",
              "type": "module",
              "displayName": "File copy constants"
            },
            {
              "textRaw": "File open constants",
              "name": "file_open_constants",
              "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>",
              "type": "module",
              "displayName": "File open constants"
            },
            {
              "textRaw": "File type constants",
              "name": "file_type_constants",
              "desc": "<p>The following constants are meant for use with the <a href=\"fs.html#fs_class_fs_stats\"><code>fs.Stats</code></a> object's\n<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>",
              "type": "module",
              "displayName": "File type constants"
            },
            {
              "textRaw": "File mode constants",
              "name": "file_mode_constants",
              "desc": "<p>The following constants are meant for use with the <a href=\"fs.html#fs_class_fs_stats\"><code>fs.Stats</code></a> object's\n<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>",
              "type": "module",
              "displayName": "File mode constants"
            }
          ],
          "type": "module",
          "displayName": "FS constants"
        },
        {
          "textRaw": "File system flags",
          "name": "file_system_flags",
          "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>'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>) ensures that path is newly\ncreated. On POSIX systems, path is considered to exist even if it is a symlink\nto a non-existent file. The exclusive flag may or may not work with network\nfile 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 a flags mode of <code>'r+'</code>\nrather than the default mode <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> or <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>",
          "type": "module",
          "displayName": "File system flags"
        }
      ],
      "classes": [
        {
          "textRaw": "Class: `fs.Dir`",
          "type": "class",
          "name": "fs.Dir",
          "meta": {
            "added": [
              "v12.12.0"
            ],
            "changes": []
          },
          "desc": "<p>A class representing a directory stream.</p>\n<p>Created by <a href=\"fs.html#fs_fs_opendir_path_options_callback\"><code>fs.opendir()</code></a>, <a href=\"fs.html#fs_fs_opendirsync_path_options\"><code>fs.opendirSync()</code></a>, or\n<a href=\"fs.html#fs_fspromises_opendir_path_options\"><code>fsPromises.opendir()</code></a>.</p>\n<pre><code class=\"language-js\">const fs = require('fs');\n\nasync function print(path) {\n  const dir = await fs.promises.opendir(path);\n  for await (const dirent of dir) {\n    console.log(dirent.name);\n  }\n}\nprint('./').catch(console.error);\n</code></pre>",
          "methods": [
            {
              "textRaw": "`dir.close()`",
              "type": "method",
              "name": "close",
              "meta": {
                "added": [
                  "v12.12.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Promise}",
                    "name": "return",
                    "type": "Promise"
                  },
                  "params": []
                }
              ],
              "desc": "<p>Asynchronously close the directory's underlying resource handle.\nSubsequent reads will result in errors.</p>\n<p>A <code>Promise</code> is returned that will be resolved after the resource has been\nclosed.</p>"
            },
            {
              "textRaw": "`dir.close(callback)`",
              "type": "method",
              "name": "close",
              "meta": {
                "added": [
                  "v12.12.0"
                ],
                "changes": []
              },
              "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()`",
              "type": "method",
              "name": "closeSync",
              "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()`",
              "type": "method",
              "name": "read",
              "meta": {
                "added": [
                  "v12.12.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Promise} containing {fs.Dirent|null}",
                    "name": "return",
                    "type": "Promise",
                    "desc": "containing {fs.Dirent|null}"
                  },
                  "params": []
                }
              ],
              "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\n<a href=\"fs.html#fs_class_fs_dirent\"><code>fs.Dirent</code></a>.</p>\n<p>After the read is completed, a <code>Promise</code> is returned that will be resolved with\nan <a href=\"fs.html#fs_class_fs_dirent\"><code>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 may or may not be\nincluded in the iteration results.</p>"
            },
            {
              "textRaw": "`dir.read(callback)`",
              "type": "method",
              "name": "read",
              "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\n<a href=\"fs.html#fs_class_fs_dirent\"><code>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#fs_class_fs_dirent\"><code>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 may or may not be\nincluded in the iteration results.</p>"
            },
            {
              "textRaw": "`dir.readSync()`",
              "type": "method",
              "name": "readSync",
              "meta": {
                "added": [
                  "v12.12.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {fs.Dirent|null}",
                    "name": "return",
                    "type": "fs.Dirent|null"
                  },
                  "params": []
                }
              ],
              "desc": "<p>Synchronously 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\n<a href=\"fs.html#fs_class_fs_dirent\"><code>fs.Dirent</code></a>.</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 may or may not be\nincluded in the iteration results.</p>"
            },
            {
              "textRaw": "`dir[Symbol.asyncIterator]()`",
              "type": "method",
              "name": "[Symbol.asyncIterator]",
              "meta": {
                "added": [
                  "v12.12.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {AsyncIterator} of {fs.Dirent}",
                    "name": "return",
                    "type": "AsyncIterator",
                    "desc": "of {fs.Dirent}"
                  },
                  "params": []
                }
              ],
              "desc": "<p>Asynchronously iterates over the directory via <a href=\"http://man7.org/linux/man-pages/man3/readdir.3.html\"><code>readdir(3)</code></a> until all entries have\nbeen read.</p>\n<p>Entries returned by the async iterator are always an <a href=\"fs.html#fs_class_fs_dirent\"><code>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#fs_class_fs_dir\"><code>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 may or may not be\nincluded in the iteration results.</p>"
            }
          ],
          "properties": [
            {
              "textRaw": "`path` {string}",
              "type": "string",
              "name": "path",
              "meta": {
                "added": [
                  "v12.12.0"
                ],
                "changes": []
              },
              "desc": "<p>The read-only path of this directory as was provided to <a href=\"fs.html#fs_fs_opendir_path_options_callback\"><code>fs.opendir()</code></a>,\n<a href=\"fs.html#fs_fs_opendirsync_path_options\"><code>fs.opendirSync()</code></a>, or <a href=\"fs.html#fs_fspromises_opendir_path_options\"><code>fsPromises.opendir()</code></a>.</p>"
            }
          ]
        },
        {
          "textRaw": "Class: `fs.Dirent`",
          "type": "class",
          "name": "fs.Dirent",
          "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#fs_class_fs_dir\"><code>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=\"fs.html#fs_fs_readdir_path_options_callback\"><code>fs.readdir()</code></a> or <a href=\"fs.html#fs_fs_readdirsync_path_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<code>fs.Dirent</code> objects, rather than strings or <code>Buffers</code>.</p>",
          "methods": [
            {
              "textRaw": "`dirent.isBlockDevice()`",
              "type": "method",
              "name": "isBlockDevice",
              "meta": {
                "added": [
                  "v10.10.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  },
                  "params": []
                }
              ],
              "desc": "<p>Returns <code>true</code> if the <code>fs.Dirent</code> object describes a block device.</p>"
            },
            {
              "textRaw": "`dirent.isCharacterDevice()`",
              "type": "method",
              "name": "isCharacterDevice",
              "meta": {
                "added": [
                  "v10.10.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  },
                  "params": []
                }
              ],
              "desc": "<p>Returns <code>true</code> if the <code>fs.Dirent</code> object describes a character device.</p>"
            },
            {
              "textRaw": "`dirent.isDirectory()`",
              "type": "method",
              "name": "isDirectory",
              "meta": {
                "added": [
                  "v10.10.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  },
                  "params": []
                }
              ],
              "desc": "<p>Returns <code>true</code> if the <code>fs.Dirent</code> object describes a file system\ndirectory.</p>"
            },
            {
              "textRaw": "`dirent.isFIFO()`",
              "type": "method",
              "name": "isFIFO",
              "meta": {
                "added": [
                  "v10.10.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  },
                  "params": []
                }
              ],
              "desc": "<p>Returns <code>true</code> if the <code>fs.Dirent</code> object describes a first-in-first-out\n(FIFO) pipe.</p>"
            },
            {
              "textRaw": "`dirent.isFile()`",
              "type": "method",
              "name": "isFile",
              "meta": {
                "added": [
                  "v10.10.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  },
                  "params": []
                }
              ],
              "desc": "<p>Returns <code>true</code> if the <code>fs.Dirent</code> object describes a regular file.</p>"
            },
            {
              "textRaw": "`dirent.isSocket()`",
              "type": "method",
              "name": "isSocket",
              "meta": {
                "added": [
                  "v10.10.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  },
                  "params": []
                }
              ],
              "desc": "<p>Returns <code>true</code> if the <code>fs.Dirent</code> object describes a socket.</p>"
            },
            {
              "textRaw": "`dirent.isSymbolicLink()`",
              "type": "method",
              "name": "isSymbolicLink",
              "meta": {
                "added": [
                  "v10.10.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  },
                  "params": []
                }
              ],
              "desc": "<p>Returns <code>true</code> if the <code>fs.Dirent</code> object describes a symbolic link.</p>"
            }
          ],
          "properties": [
            {
              "textRaw": "`name` {string|Buffer}",
              "type": "string|Buffer",
              "name": "name",
              "meta": {
                "added": [
                  "v10.10.0"
                ],
                "changes": []
              },
              "desc": "<p>The file name that this <code>fs.Dirent</code> object refers to. The type of this\nvalue is determined by the <code>options.encoding</code> passed to <a href=\"fs.html#fs_fs_readdir_path_options_callback\"><code>fs.readdir()</code></a> or\n<a href=\"fs.html#fs_fs_readdirsync_path_options\"><code>fs.readdirSync()</code></a>.</p>"
            }
          ]
        },
        {
          "textRaw": "Class: `fs.FSWatcher`",
          "type": "class",
          "name": "fs.FSWatcher",
          "meta": {
            "added": [
              "v0.5.8"
            ],
            "changes": []
          },
          "desc": "<ul>\n<li>Extends <a href=\"events.html#events_class_eventemitter\" class=\"type\">&lt;EventEmitter&gt;</a></li>\n</ul>\n<p>A successful call to <a href=\"fs.html#fs_fs_watch_filename_options_listener\"><code>fs.watch()</code></a> method will return a new <code>fs.FSWatcher</code>\nobject.</p>\n<p>All <code>fs.FSWatcher</code> objects emit a <code>'change'</code> event whenever a specific watched\nfile is modified.</p>",
          "events": [
            {
              "textRaw": "Event: `'change'`",
              "type": "event",
              "name": "change",
              "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=\"fs.html#fs_fs_watch_filename_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 <code>Buffer</code> if\n<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-js\">// Example when handled through fs.watch() listener\nfs.watch('./tmp', { encoding: 'buffer' }, (eventType, filename) => {\n  if (filename) {\n    console.log(filename);\n    // Prints: &#x3C;Buffer ...>\n  }\n});\n</code></pre>"
            },
            {
              "textRaw": "Event: `'close'`",
              "type": "event",
              "name": "close",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "params": [],
              "desc": "<p>Emitted when the watcher stops watching for changes. The closed\n<code>fs.FSWatcher</code> object is no longer usable in the event handler.</p>"
            },
            {
              "textRaw": "Event: `'error'`",
              "type": "event",
              "name": "error",
              "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<code>fs.FSWatcher</code> object is no longer usable in the event handler.</p>"
            }
          ],
          "methods": [
            {
              "textRaw": "`watcher.close()`",
              "type": "method",
              "name": "close",
              "meta": {
                "added": [
                  "v0.5.8"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Stop watching for changes on the given <code>fs.FSWatcher</code>. Once stopped, the\n<code>fs.FSWatcher</code> object is no longer usable.</p>"
            }
          ]
        },
        {
          "textRaw": "Class: `fs.ReadStream`",
          "type": "class",
          "name": "fs.ReadStream",
          "meta": {
            "added": [
              "v0.1.93"
            ],
            "changes": []
          },
          "desc": "<ul>\n<li>Extends: <a href=\"stream.html#stream_class_stream_readable\" class=\"type\">&lt;stream.Readable&gt;</a></li>\n</ul>\n<p>A successful call to <code>fs.createReadStream()</code> will return a new <code>fs.ReadStream</code>\nobject.</p>",
          "events": [
            {
              "textRaw": "Event: `'close'`",
              "type": "event",
              "name": "close",
              "meta": {
                "added": [
                  "v0.1.93"
                ],
                "changes": []
              },
              "params": [],
              "desc": "<p>Emitted when the <code>fs.ReadStream</code>'s underlying file descriptor has been closed.</p>"
            },
            {
              "textRaw": "Event: `'open'`",
              "type": "event",
              "name": "open",
              "meta": {
                "added": [
                  "v0.1.93"
                ],
                "changes": []
              },
              "params": [
                {
                  "textRaw": "`fd` {integer} Integer file descriptor used by the `ReadStream`.",
                  "name": "fd",
                  "type": "integer",
                  "desc": "Integer file descriptor used by the `ReadStream`."
                }
              ],
              "desc": "<p>Emitted when the <code>fs.ReadStream</code>'s file descriptor has been opened.</p>"
            },
            {
              "textRaw": "Event: `'ready'`",
              "type": "event",
              "name": "ready",
              "meta": {
                "added": [
                  "v9.11.0"
                ],
                "changes": []
              },
              "params": [],
              "desc": "<p>Emitted when the <code>fs.ReadStream</code> is ready to be used.</p>\n<p>Fires immediately after <code>'open'</code>.</p>"
            }
          ],
          "properties": [
            {
              "textRaw": "`bytesRead` {number}",
              "type": "number",
              "name": "bytesRead",
              "meta": {
                "added": [
                  "v6.4.0"
                ],
                "changes": []
              },
              "desc": "<p>The number of bytes that have been read so far.</p>"
            },
            {
              "textRaw": "`path` {string|Buffer}",
              "type": "string|Buffer",
              "name": "path",
              "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 <code>Buffer</code>, then\n<code>readStream.path</code> will be a <code>Buffer</code>.</p>"
            },
            {
              "textRaw": "`pending` {boolean}",
              "type": "boolean",
              "name": "pending",
              "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>"
            }
          ]
        },
        {
          "textRaw": "Class: `fs.Stats`",
          "type": "class",
          "name": "fs.Stats",
          "meta": {
            "added": [
              "v0.1.21"
            ],
            "changes": [
              {
                "version": "v8.1.0",
                "pr-url": "https://github.com/nodejs/node/pull/13173",
                "description": "Added times as numbers."
              }
            ]
          },
          "desc": "<p>A <code>fs.Stats</code> object provides information about a file.</p>\n<p>Objects returned from <a href=\"fs.html#fs_fs_stat_path_options_callback\"><code>fs.stat()</code></a>, <a href=\"fs.html#fs_fs_lstat_path_options_callback\"><code>fs.lstat()</code></a> and <a href=\"fs.html#fs_fs_fstat_fd_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>.</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  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</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  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</code></pre>",
          "methods": [
            {
              "textRaw": "`stats.isBlockDevice()`",
              "type": "method",
              "name": "isBlockDevice",
              "meta": {
                "added": [
                  "v0.1.10"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  },
                  "params": []
                }
              ],
              "desc": "<p>Returns <code>true</code> if the <code>fs.Stats</code> object describes a block device.</p>"
            },
            {
              "textRaw": "`stats.isCharacterDevice()`",
              "type": "method",
              "name": "isCharacterDevice",
              "meta": {
                "added": [
                  "v0.1.10"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  },
                  "params": []
                }
              ],
              "desc": "<p>Returns <code>true</code> if the <code>fs.Stats</code> object describes a character device.</p>"
            },
            {
              "textRaw": "`stats.isDirectory()`",
              "type": "method",
              "name": "isDirectory",
              "meta": {
                "added": [
                  "v0.1.10"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  },
                  "params": []
                }
              ],
              "desc": "<p>Returns <code>true</code> if the <code>fs.Stats</code> object describes a file system directory.</p>"
            },
            {
              "textRaw": "`stats.isFIFO()`",
              "type": "method",
              "name": "isFIFO",
              "meta": {
                "added": [
                  "v0.1.10"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  },
                  "params": []
                }
              ],
              "desc": "<p>Returns <code>true</code> if the <code>fs.Stats</code> object describes a first-in-first-out (FIFO)\npipe.</p>"
            },
            {
              "textRaw": "`stats.isFile()`",
              "type": "method",
              "name": "isFile",
              "meta": {
                "added": [
                  "v0.1.10"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  },
                  "params": []
                }
              ],
              "desc": "<p>Returns <code>true</code> if the <code>fs.Stats</code> object describes a regular file.</p>"
            },
            {
              "textRaw": "`stats.isSocket()`",
              "type": "method",
              "name": "isSocket",
              "meta": {
                "added": [
                  "v0.1.10"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  },
                  "params": []
                }
              ],
              "desc": "<p>Returns <code>true</code> if the <code>fs.Stats</code> object describes a socket.</p>"
            },
            {
              "textRaw": "`stats.isSymbolicLink()`",
              "type": "method",
              "name": "isSymbolicLink",
              "meta": {
                "added": [
                  "v0.1.10"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  },
                  "params": []
                }
              ],
              "desc": "<p>Returns <code>true</code> if the <code>fs.Stats</code> object describes a symbolic link.</p>\n<p>This method is only valid when using <a href=\"fs.html#fs_fs_lstat_path_options_callback\"><code>fs.lstat()</code></a>.</p>"
            }
          ],
          "properties": [
            {
              "textRaw": "`dev` {number|bigint}",
              "type": "number|bigint",
              "name": "dev",
              "desc": "<p>The numeric identifier of the device containing the file.</p>"
            },
            {
              "textRaw": "`ino` {number|bigint}",
              "type": "number|bigint",
              "name": "ino",
              "desc": "<p>The file system specific \"Inode\" number for the file.</p>"
            },
            {
              "textRaw": "`mode` {number|bigint}",
              "type": "number|bigint",
              "name": "mode",
              "desc": "<p>A bit-field describing the file type and mode.</p>"
            },
            {
              "textRaw": "`nlink` {number|bigint}",
              "type": "number|bigint",
              "name": "nlink",
              "desc": "<p>The number of hard-links that exist for the file.</p>"
            },
            {
              "textRaw": "`uid` {number|bigint}",
              "type": "number|bigint",
              "name": "uid",
              "desc": "<p>The numeric user identifier of the user that owns the file (POSIX).</p>"
            },
            {
              "textRaw": "`gid` {number|bigint}",
              "type": "number|bigint",
              "name": "gid",
              "desc": "<p>The numeric group identifier of the group that owns the file (POSIX).</p>"
            },
            {
              "textRaw": "`rdev` {number|bigint}",
              "type": "number|bigint",
              "name": "rdev",
              "desc": "<p>A numeric device identifier if the file is considered \"special\".</p>"
            },
            {
              "textRaw": "`size` {number|bigint}",
              "type": "number|bigint",
              "name": "size",
              "desc": "<p>The size of the file in bytes.</p>"
            },
            {
              "textRaw": "`blksize` {number|bigint}",
              "type": "number|bigint",
              "name": "blksize",
              "desc": "<p>The file system block size for i/o operations.</p>"
            },
            {
              "textRaw": "`blocks` {number|bigint}",
              "type": "number|bigint",
              "name": "blocks",
              "desc": "<p>The number of blocks allocated for this file.</p>"
            },
            {
              "textRaw": "`atimeMs` {number|bigint}",
              "type": "number|bigint",
              "name": "atimeMs",
              "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": "`mtimeMs` {number|bigint}",
              "type": "number|bigint",
              "name": "mtimeMs",
              "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": "`ctimeMs` {number|bigint}",
              "type": "number|bigint",
              "name": "ctimeMs",
              "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": "`birthtimeMs` {number|bigint}",
              "type": "number|bigint",
              "name": "birthtimeMs",
              "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": "`atimeNs` {bigint}",
              "type": "bigint",
              "name": "atimeNs",
              "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": "`mtimeNs` {bigint}",
              "type": "bigint",
              "name": "mtimeNs",
              "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": "`ctimeNs` {bigint}",
              "type": "bigint",
              "name": "ctimeNs",
              "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": "`birthtimeNs` {bigint}",
              "type": "bigint",
              "name": "birthtimeNs",
              "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": "`atime` {Date}",
              "type": "Date",
              "name": "atime",
              "meta": {
                "added": [
                  "v0.11.13"
                ],
                "changes": []
              },
              "desc": "<p>The timestamp indicating the last time this file was accessed.</p>"
            },
            {
              "textRaw": "`mtime` {Date}",
              "type": "Date",
              "name": "mtime",
              "meta": {
                "added": [
                  "v0.11.13"
                ],
                "changes": []
              },
              "desc": "<p>The timestamp indicating the last time this file was modified.</p>"
            },
            {
              "textRaw": "`ctime` {Date}",
              "type": "Date",
              "name": "ctime",
              "meta": {
                "added": [
                  "v0.11.13"
                ],
                "changes": []
              },
              "desc": "<p>The timestamp indicating the last time the file status was changed.</p>"
            },
            {
              "textRaw": "`birthtime` {Date}",
              "type": "Date",
              "name": "birthtime",
              "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",
              "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/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 filesystems 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>",
              "type": "module",
              "displayName": "Stat time values"
            }
          ]
        },
        {
          "textRaw": "Class: `fs.WriteStream`",
          "type": "class",
          "name": "fs.WriteStream",
          "meta": {
            "added": [
              "v0.1.93"
            ],
            "changes": []
          },
          "desc": "<ul>\n<li>Extends <a href=\"stream.html#stream_class_stream_writable\" class=\"type\">&lt;stream.Writable&gt;</a></li>\n</ul>",
          "events": [
            {
              "textRaw": "Event: `'close'`",
              "type": "event",
              "name": "close",
              "meta": {
                "added": [
                  "v0.1.93"
                ],
                "changes": []
              },
              "params": [],
              "desc": "<p>Emitted when the <code>WriteStream</code>'s underlying file descriptor has been closed.</p>"
            },
            {
              "textRaw": "Event: `'open'`",
              "type": "event",
              "name": "open",
              "meta": {
                "added": [
                  "v0.1.93"
                ],
                "changes": []
              },
              "params": [
                {
                  "textRaw": "`fd` {integer} Integer file descriptor used by the `WriteStream`.",
                  "name": "fd",
                  "type": "integer",
                  "desc": "Integer file descriptor used by the `WriteStream`."
                }
              ],
              "desc": "<p>Emitted when the <code>WriteStream</code>'s file is opened.</p>"
            },
            {
              "textRaw": "Event: `'ready'`",
              "type": "event",
              "name": "ready",
              "meta": {
                "added": [
                  "v9.11.0"
                ],
                "changes": []
              },
              "params": [],
              "desc": "<p>Emitted when the <code>fs.WriteStream</code> is ready to be used.</p>\n<p>Fires immediately after <code>'open'</code>.</p>"
            }
          ],
          "properties": [
            {
              "textRaw": "`writeStream.bytesWritten`",
              "name": "bytesWritten",
              "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",
              "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=\"fs.html#fs_fs_createwritestream_path_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 <code>Buffer</code>, then\n<code>writeStream.path</code> will be a <code>Buffer</code>.</p>"
            },
            {
              "textRaw": "`pending` {boolean}",
              "type": "boolean",
              "name": "pending",
              "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": "`fs.access(path[, mode], callback)`",
          "type": "method",
          "name": "access",
          "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. Support is currently still *experimental*."
              },
              {
                "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`"
                },
                {
                  "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. Check <a href=\"fs.html#fs_file_access_constants\">File access constants</a> for possible values\nof <code>mode</code>. It is possible to create a mask consisting of the bitwise OR of\ntwo or more values (e.g. <code>fs.constants.W_OK | fs.constants.R_OK</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-js\">const file = 'package.json';\n\n// Check if the file exists in the current directory.\nfs.access(file, fs.constants.F_OK, (err) => {\n  console.log(`${file} ${err ? 'does not exist' : 'exists'}`);\n});\n\n// Check if the file is readable.\nfs.access(file, fs.constants.R_OK, (err) => {\n  console.log(`${file} ${err ? 'is not readable' : 'is readable'}`);\n});\n\n// Check if the file is writable.\nfs.access(file, fs.constants.W_OK, (err) => {\n  console.log(`${file} ${err ? 'is not writable' : 'is writable'}`);\n});\n\n// Check if the file exists in the current directory, and if it is writable.\nfs.access(file, fs.constants.F_OK | fs.constants.W_OK, (err) => {\n  if (err) {\n    console.error(\n      `${file} ${err.code === 'ENOENT' ? 'does not exist' : 'is read-only'}`);\n  } else {\n    console.log(`${file} exists, and it is writable`);\n  }\n});\n</code></pre>\n<p>Using <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> 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 is not accessible.</p>\n<p><strong>write (NOT RECOMMENDED)</strong></p>\n<pre><code class=\"language-js\">fs.access('myfile', (err) => {\n  if (!err) {\n    console.error('myfile already exists');\n    return;\n  }\n\n  fs.open('myfile', 'wx', (err, fd) => {\n    if (err) throw err;\n    writeMyData(fd);\n  });\n});\n</code></pre>\n<p><strong>write (RECOMMENDED)</strong></p>\n<pre><code class=\"language-js\">fs.open('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  writeMyData(fd);\n});\n</code></pre>\n<p><strong>read (NOT RECOMMENDED)</strong></p>\n<pre><code class=\"language-js\">fs.access('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  fs.open('myfile', 'r', (err, fd) => {\n    if (err) throw err;\n    readMyData(fd);\n  });\n});\n</code></pre>\n<p><strong>read (RECOMMENDED)</strong></p>\n<pre><code class=\"language-js\">fs.open('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  readMyData(fd);\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.accessSync(path[, mode])`",
          "type": "method",
          "name": "accessSync",
          "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. Support is currently still *experimental*."
              }
            ]
          },
          "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`"
                }
              ]
            }
          ],
          "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. Check <a href=\"fs.html#fs_file_access_constants\">File access constants</a> for\npossible values of <code>mode</code>. It is possible to create a mask consisting of\nthe bitwise OR of two or more values\n(e.g. <code>fs.constants.W_OK | fs.constants.R_OK</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-js\">try {\n  fs.accessSync('etc/passwd', fs.constants.R_OK | fs.constants.W_OK);\n  console.log('can read/write');\n} catch (err) {\n  console.error('no access!');\n}\n</code></pre>"
        },
        {
          "textRaw": "`fs.appendFile(path, data[, options], callback)`",
          "type": "method",
          "name": "appendFile",
          "meta": {
            "added": [
              "v0.6.7"
            ],
            "changes": [
              {
                "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": "`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#buffer_buffer\"><code>Buffer</code></a>.</p>\n<pre><code class=\"language-js\">fs.appendFile('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-js\">fs.appendFile('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-js\">fs.open('message.txt', 'a', (err, fd) => {\n  if (err) throw err;\n  fs.appendFile(fd, 'data to append', 'utf8', (err) => {\n    fs.close(fd, (err) => {\n      if (err) throw err;\n    });\n    if (err) throw err;\n  });\n});\n</code></pre>"
        },
        {
          "textRaw": "`fs.appendFileSync(path, data[, options])`",
          "type": "method",
          "name": "appendFileSync",
          "meta": {
            "added": [
              "v0.6.7"
            ],
            "changes": [
              {
                "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`][]."
                    }
                  ]
                }
              ]
            }
          ],
          "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#buffer_buffer\"><code>Buffer</code></a>.</p>\n<pre><code class=\"language-js\">try {\n  fs.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-js\">fs.appendFileSync('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-js\">let fd;\n\ntry {\n  fd = fs.openSync('message.txt', 'a');\n  fs.appendFileSync(fd, 'data to append', 'utf8');\n} catch (err) {\n  /* Handle the error */\n} finally {\n  if (fd !== undefined)\n    fs.closeSync(fd);\n}\n</code></pre>"
        },
        {
          "textRaw": "`fs.chmod(path, mode, callback)`",
          "type": "method",
          "name": "chmod",
          "meta": {
            "added": [
              "v0.1.30"
            ],
            "changes": [
              {
                "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. 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": "`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 also: <a href=\"http://man7.org/linux/man-pages/man2/chmod.2.html\"><code>chmod(2)</code></a>.</p>\n<pre><code class=\"language-js\">fs.chmod('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",
              "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 not\nexposed 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>",
              "type": "module",
              "displayName": "File modes"
            }
          ]
        },
        {
          "textRaw": "`fs.chmodSync(path, mode)`",
          "type": "method",
          "name": "chmodSync",
          "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. Support is currently still *experimental*."
              }
            ]
          },
          "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=\"fs.html#fs_fs_chmod_path_mode_callback\"><code>fs.chmod()</code></a>.</p>\n<p>See also: <a href=\"http://man7.org/linux/man-pages/man2/chmod.2.html\"><code>chmod(2)</code></a>.</p>"
        },
        {
          "textRaw": "`fs.chown(path, uid, gid, callback)`",
          "type": "method",
          "name": "chown",
          "meta": {
            "added": [
              "v0.1.97"
            ],
            "changes": [
              {
                "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. 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": "`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 also: <a href=\"http://man7.org/linux/man-pages/man2/chown.2.html\"><code>chown(2)</code></a>.</p>"
        },
        {
          "textRaw": "`fs.chownSync(path, uid, gid)`",
          "type": "method",
          "name": "chownSync",
          "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. Support is currently still *experimental*."
              }
            ]
          },
          "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=\"fs.html#fs_fs_chown_path_uid_gid_callback\"><code>fs.chown()</code></a>.</p>\n<p>See also: <a href=\"http://man7.org/linux/man-pages/man2/chown.2.html\"><code>chown(2)</code></a>.</p>"
        },
        {
          "textRaw": "`fs.close(fd, callback)`",
          "type": "method",
          "name": "close",
          "meta": {
            "added": [
              "v0.0.2"
            ],
            "changes": [
              {
                "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>Asynchronous <a href=\"http://man7.org/linux/man-pages/man2/close.2.html\"><code>close(2)</code></a>. No arguments other than a possible exception are given\nto 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>"
        },
        {
          "textRaw": "`fs.closeSync(fd)`",
          "type": "method",
          "name": "closeSync",
          "meta": {
            "added": [
              "v0.1.21"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`fd` {integer}",
                  "name": "fd",
                  "type": "integer"
                }
              ]
            }
          ],
          "desc": "<p>Synchronous <a href=\"http://man7.org/linux/man-pages/man2/close.2.html\"><code>close(2)</code></a>. 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>"
        },
        {
          "textRaw": "`fs.copyFile(src, dest[, flags], callback)`",
          "type": "method",
          "name": "copyFile",
          "meta": {
            "added": [
              "v8.5.0"
            ],
            "changes": []
          },
          "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": "`flags` {number} modifiers for copy operation. **Default:** `0`.",
                  "name": "flags",
                  "type": "number",
                  "default": "`0`",
                  "desc": "modifiers for copy operation."
                },
                {
                  "textRaw": "`callback` {Function}",
                  "name": "callback",
                  "type": "Function"
                }
              ]
            }
          ],
          "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>flags</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 copy-on-write,\nthen the operation will fail.</li>\n</ul>\n<pre><code class=\"language-js\">const fs = require('fs');\n\n// destination.txt will be created or overwritten by default.\nfs.copyFile('source.txt', 'destination.txt', (err) => {\n  if (err) throw err;\n  console.log('source.txt was copied to destination.txt');\n});\n</code></pre>\n<p>If the third argument is a number, then it specifies <code>flags</code>:</p>\n<pre><code class=\"language-js\">const fs = require('fs');\nconst { COPYFILE_EXCL } = fs.constants;\n\n// By using COPYFILE_EXCL, the operation will fail if destination.txt exists.\nfs.copyFile('source.txt', 'destination.txt', COPYFILE_EXCL, callback);\n</code></pre>"
        },
        {
          "textRaw": "`fs.copyFileSync(src, dest[, flags])`",
          "type": "method",
          "name": "copyFileSync",
          "meta": {
            "added": [
              "v8.5.0"
            ],
            "changes": []
          },
          "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": "`flags` {number} modifiers for copy operation. **Default:** `0`.",
                  "name": "flags",
                  "type": "number",
                  "default": "`0`",
                  "desc": "modifiers for copy operation."
                }
              ]
            }
          ],
          "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>flags</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 copy-on-write,\nthen the operation will fail.</li>\n</ul>\n<pre><code class=\"language-js\">const fs = require('fs');\n\n// destination.txt will be created or overwritten by default.\nfs.copyFileSync('source.txt', 'destination.txt');\nconsole.log('source.txt was copied to destination.txt');\n</code></pre>\n<p>If the third argument is a number, then it specifies <code>flags</code>:</p>\n<pre><code class=\"language-js\">const fs = require('fs');\nconst { COPYFILE_EXCL } = fs.constants;\n\n// By using COPYFILE_EXCL, the operation will fail if destination.txt exists.\nfs.copyFileSync('source.txt', 'destination.txt', COPYFILE_EXCL);\n</code></pre>"
        },
        {
          "textRaw": "`fs.createReadStream(path[, options])`",
          "type": "method",
          "name": "createReadStream",
          "meta": {
            "added": [
              "v0.1.31"
            ],
            "changes": [
              {
                "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. Support is currently still *experimental*."
              },
              {
                "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."
              },
              {
                "version": "v12.17.0",
                "pr-url": "https://github.com/nodejs/node/pull/29083",
                "description": "The `fs` options allow overriding the used `fs` implementation."
              }
            ]
          },
          "signatures": [
            {
              "return": {
                "textRaw": "Returns: {fs.ReadStream} See [Readable Stream][].",
                "name": "return",
                "type": "fs.ReadStream",
                "desc": "See [Readable Stream][]."
              },
              "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} **Default:** `null`",
                      "name": "fd",
                      "type": "integer",
                      "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:** `false`",
                      "name": "emitClose",
                      "type": "boolean",
                      "default": "`false`"
                    },
                    {
                      "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`"
                    }
                  ]
                }
              ]
            }
          ],
          "desc": "<p>Unlike the 16 kb default <code>highWaterMark</code> for a readable stream, the stream\nreturned by this method has a default <code>highWaterMark</code> of 64 kb.</p>\n<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#buffer_buffer\"><code>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#net_class_net_socket\"><code>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 not emit a <code>'close'</code> event after it has been\ndestroyed. This is the opposite of the default for other <code>Readable</code> streams.\nSet the <code>emitClose</code> option to <code>true</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,\noverrides for <code>open</code>, <code>read</code>, and <code>close</code> are required.</p>\n<pre><code class=\"language-js\">const fs = require('fs');\n// Create a stream from some character device.\nconst stream = fs.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-js\">fs.createReadStream('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])`",
          "type": "method",
          "name": "createWriteStream",
          "meta": {
            "added": [
              "v0.1.31"
            ],
            "changes": [
              {
                "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. Support is currently still *experimental*."
              },
              {
                "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."
              },
              {
                "version": "v12.17.0",
                "pr-url": "https://github.com/nodejs/node/pull/v12.17.0",
                "description": "The `fs` options allow overriding the used `fs` implementation."
              }
            ]
          },
          "signatures": [
            {
              "return": {
                "textRaw": "Returns: {fs.WriteStream} See [Writable Stream][].",
                "name": "return",
                "type": "fs.WriteStream",
                "desc": "See [Writable Stream][]."
              },
              "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} **Default:** `null`",
                      "name": "fd",
                      "type": "integer",
                      "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:** `false`",
                      "name": "emitClose",
                      "type": "boolean",
                      "default": "`false`"
                    },
                    {
                      "textRaw": "`start` {integer}",
                      "name": "start",
                      "type": "integer"
                    },
                    {
                      "textRaw": "`fs` {Object|null} **Default:** `null`",
                      "name": "fs",
                      "type": "Object|null",
                      "default": "`null`"
                    }
                  ]
                }
              ]
            }
          ],
          "desc": "<p><code>options</code> may also include a <code>start</code> option to allow writing data at\nsome position 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\nthan replacing it may require a <code>flags</code> mode of <code>r+</code> rather than the\ndefault mode <code>w</code>. The <code>encoding</code> can be any one of those accepted by\n<a href=\"buffer.html#buffer_buffer\"><code>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 not emit a <code>'close'</code> event after it has been\ndestroyed. This is the opposite of the default for other <code>Writable</code> streams.\nSet the <code>emitClose</code> option to <code>true</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 <code>open</code>,\n<code>close</code>, and at least one of <code>write</code> and <code>writev</code> are required.</p>\n<p>Like <a href=\"fs.html#fs_class_fs_readstream\"><code>ReadStream</code></a>, if <code>fd</code> is specified, <a href=\"fs.html#fs_class_fs_writestream\"><code>WriteStream</code></a> will ignore the\n<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#net_class_net_socket\"><code>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)`",
          "type": "method",
          "name": "exists",
          "meta": {
            "added": [
              "v0.0.2"
            ],
            "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. Support is currently still *experimental*."
              }
            ],
            "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 given path 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-js\">fs.exists('/etc/passwd', (exists) => {\n  console.log(exists ? 'it\\'s there' : '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>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-js\">fs.exists('myfile', (exists) => {\n  if (exists) {\n    console.error('myfile already exists');\n  } else {\n    fs.open('myfile', 'wx', (err, fd) => {\n      if (err) throw err;\n      writeMyData(fd);\n    });\n  }\n});\n</code></pre>\n<p><strong>write (RECOMMENDED)</strong></p>\n<pre><code class=\"language-js\">fs.open('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  writeMyData(fd);\n});\n</code></pre>\n<p><strong>read (NOT RECOMMENDED)</strong></p>\n<pre><code class=\"language-js\">fs.exists('myfile', (exists) => {\n  if (exists) {\n    fs.open('myfile', 'r', (err, fd) => {\n      if (err) throw err;\n      readMyData(fd);\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-js\">fs.open('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  readMyData(fd);\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.existsSync(path)`",
          "type": "method",
          "name": "existsSync",
          "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. Support is currently still *experimental*."
              }
            ]
          },
          "signatures": [
            {
              "return": {
                "textRaw": "Returns: {boolean}",
                "name": "return",
                "type": "boolean"
              },
              "params": [
                {
                  "textRaw": "`path` {string|Buffer|URL}",
                  "name": "path",
                  "type": "string|Buffer|URL"
                }
              ]
            }
          ],
          "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=\"fs.html#fs_fs_exists_path_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-js\">if (fs.existsSync('/etc/passwd')) {\n  console.log('The path exists.');\n}\n</code></pre>"
        },
        {
          "textRaw": "`fs.fchmod(fd, mode, callback)`",
          "type": "method",
          "name": "fchmod",
          "meta": {
            "added": [
              "v0.4.7"
            ],
            "changes": [
              {
                "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>Asynchronous <a href=\"http://man7.org/linux/man-pages/man2/fchmod.2.html\"><code>fchmod(2)</code></a>. No arguments other than a possible exception\nare given to the completion callback.</p>"
        },
        {
          "textRaw": "`fs.fchmodSync(fd, mode)`",
          "type": "method",
          "name": "fchmodSync",
          "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>Synchronous <a href=\"http://man7.org/linux/man-pages/man2/fchmod.2.html\"><code>fchmod(2)</code></a>. Returns <code>undefined</code>.</p>"
        },
        {
          "textRaw": "`fs.fchown(fd, uid, gid, callback)`",
          "type": "method",
          "name": "fchown",
          "meta": {
            "added": [
              "v0.4.7"
            ],
            "changes": [
              {
                "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>Asynchronous <a href=\"http://man7.org/linux/man-pages/man2/fchown.2.html\"><code>fchown(2)</code></a>. No arguments other than a possible exception are given\nto the completion callback.</p>"
        },
        {
          "textRaw": "`fs.fchownSync(fd, uid, gid)`",
          "type": "method",
          "name": "fchownSync",
          "meta": {
            "added": [
              "v0.4.7"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`fd` {integer}",
                  "name": "fd",
                  "type": "integer"
                },
                {
                  "textRaw": "`uid` {integer}",
                  "name": "uid",
                  "type": "integer"
                },
                {
                  "textRaw": "`gid` {integer}",
                  "name": "gid",
                  "type": "integer"
                }
              ]
            }
          ],
          "desc": "<p>Synchronous <a href=\"http://man7.org/linux/man-pages/man2/fchown.2.html\"><code>fchown(2)</code></a>. Returns <code>undefined</code>.</p>"
        },
        {
          "textRaw": "`fs.fdatasync(fd, callback)`",
          "type": "method",
          "name": "fdatasync",
          "meta": {
            "added": [
              "v0.1.96"
            ],
            "changes": [
              {
                "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>Asynchronous <a href=\"http://man7.org/linux/man-pages/man2/fdatasync.2.html\"><code>fdatasync(2)</code></a>. No arguments other than a possible exception are\ngiven to the completion callback.</p>"
        },
        {
          "textRaw": "`fs.fdatasyncSync(fd)`",
          "type": "method",
          "name": "fdatasyncSync",
          "meta": {
            "added": [
              "v0.1.96"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`fd` {integer}",
                  "name": "fd",
                  "type": "integer"
                }
              ]
            }
          ],
          "desc": "<p>Synchronous <a href=\"http://man7.org/linux/man-pages/man2/fdatasync.2.html\"><code>fdatasync(2)</code></a>. Returns <code>undefined</code>.</p>"
        },
        {
          "textRaw": "`fs.fstat(fd[, options], callback)`",
          "type": "method",
          "name": "fstat",
          "meta": {
            "added": [
              "v0.1.95"
            ],
            "changes": [
              {
                "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": "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`."
                    }
                  ]
                },
                {
                  "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/fstat.2.html\"><code>fstat(2)</code></a>. The callback gets two arguments <code>(err, stats)</code> where\n<code>stats</code> is an <a href=\"fs.html#fs_class_fs_stats\"><code>fs.Stats</code></a> object. <code>fstat()</code> is identical to <a href=\"fs.html#fs_fs_stat_path_options_callback\"><code>stat()</code></a>,\nexcept that the file to be stat-ed is specified by the file descriptor <code>fd</code>.</p>"
        },
        {
          "textRaw": "`fs.fstatSync(fd[, options])`",
          "type": "method",
          "name": "fstatSync",
          "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": [
            {
              "return": {
                "textRaw": "Returns: {fs.Stats}",
                "name": "return",
                "type": "fs.Stats"
              },
              "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`."
                    }
                  ]
                }
              ]
            }
          ],
          "desc": "<p>Synchronous <a href=\"http://man7.org/linux/man-pages/man2/fstat.2.html\"><code>fstat(2)</code></a>.</p>"
        },
        {
          "textRaw": "`fs.fsync(fd, callback)`",
          "type": "method",
          "name": "fsync",
          "meta": {
            "added": [
              "v0.1.96"
            ],
            "changes": [
              {
                "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>Asynchronous <a href=\"http://man7.org/linux/man-pages/man2/fsync.2.html\"><code>fsync(2)</code></a>. No arguments other than a possible exception are given\nto the completion callback.</p>"
        },
        {
          "textRaw": "`fs.fsyncSync(fd)`",
          "type": "method",
          "name": "fsyncSync",
          "meta": {
            "added": [
              "v0.1.96"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`fd` {integer}",
                  "name": "fd",
                  "type": "integer"
                }
              ]
            }
          ],
          "desc": "<p>Synchronous <a href=\"http://man7.org/linux/man-pages/man2/fsync.2.html\"><code>fsync(2)</code></a>. Returns <code>undefined</code>.</p>"
        },
        {
          "textRaw": "`fs.ftruncate(fd[, len], callback)`",
          "type": "method",
          "name": "ftruncate",
          "meta": {
            "added": [
              "v0.8.6"
            ],
            "changes": [
              {
                "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`"
                },
                {
                  "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/ftruncate.2.html\"><code>ftruncate(2)</code></a>. No arguments other than a possible exception are\ngiven to the completion callback.</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-js\">console.log(fs.readFileSync('temp.txt', 'utf8'));\n// Prints: Node.js\n\n// get the file descriptor of the file to be truncated\nconst fd = fs.openSync('temp.txt', 'r+');\n\n// Truncate the file to first four bytes\nfs.ftruncate(fd, 4, (err) => {\n  assert.ifError(err);\n  console.log(fs.readFileSync('temp.txt', 'utf8'));\n});\n// Prints: Node\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<pre><code class=\"language-js\">console.log(fs.readFileSync('temp.txt', 'utf8'));\n// Prints: Node.js\n\n// get the file descriptor of the file to be truncated\nconst fd = fs.openSync('temp.txt', 'r+');\n\n// Truncate the file to 10 bytes, whereas the actual size is 7 bytes\nfs.ftruncate(fd, 10, (err) => {\n  assert.ifError(err);\n  console.log(fs.readFileSync('temp.txt'));\n});\n// Prints: &#x3C;Buffer 4e 6f 64 65 2e 6a 73 00 00 00>\n// ('Node.js\\0\\0\\0' in UTF8)\n</code></pre>\n<p>The last three bytes are null bytes (<code>'\\0'</code>), to compensate the over-truncation.</p>"
        },
        {
          "textRaw": "`fs.ftruncateSync(fd[, len])`",
          "type": "method",
          "name": "ftruncateSync",
          "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`"
                }
              ]
            }
          ],
          "desc": "<p>Returns <code>undefined</code>.</p>\n<p>For detailed information, see the documentation of the asynchronous version of\nthis API: <a href=\"fs.html#fs_fs_ftruncate_fd_len_callback\"><code>fs.ftruncate()</code></a>.</p>"
        },
        {
          "textRaw": "`fs.futimes(fd, atime, mtime, callback)`",
          "type": "method",
          "name": "futimes",
          "meta": {
            "added": [
              "v0.4.2"
            ],
            "changes": [
              {
                "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=\"fs.html#fs_fs_utimes_path_atime_mtime_callback\"><code>fs.utimes()</code></a>.</p>\n<p>This function does not work on AIX versions before 7.1, it will return the\nerror <code>UV_ENOSYS</code>.</p>"
        },
        {
          "textRaw": "`fs.futimesSync(fd, atime, mtime)`",
          "type": "method",
          "name": "futimesSync",
          "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=\"fs.html#fs_fs_futimes_fd_atime_mtime_callback\"><code>fs.futimes()</code></a>. Returns <code>undefined</code>.</p>"
        },
        {
          "textRaw": "`fs.lchmod(path, mode, callback)`",
          "type": "method",
          "name": "lchmod",
          "meta": {
            "deprecated": [
              "v0.4.7"
            ],
            "changes": [
              {
                "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": "`mode` {integer}",
                  "name": "mode",
                  "type": "integer"
                },
                {
                  "textRaw": "`callback` {Function}",
                  "name": "callback",
                  "type": "Function",
                  "options": [
                    {
                      "textRaw": "`err` {Error}",
                      "name": "err",
                      "type": "Error"
                    }
                  ]
                }
              ]
            }
          ],
          "desc": "<p>Asynchronous <a href=\"https://www.freebsd.org/cgi/man.cgi?query=lchmod&sektion=2\"><code>lchmod(2)</code></a>. No arguments other than a possible exception\nare given to the completion callback.</p>\n<p>Only available on macOS.</p>"
        },
        {
          "textRaw": "`fs.lchmodSync(path, mode)`",
          "type": "method",
          "name": "lchmodSync",
          "meta": {
            "deprecated": [
              "v0.4.7"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`path` {string|Buffer|URL}",
                  "name": "path",
                  "type": "string|Buffer|URL"
                },
                {
                  "textRaw": "`mode` {integer}",
                  "name": "mode",
                  "type": "integer"
                }
              ]
            }
          ],
          "desc": "<p>Synchronous <a href=\"https://www.freebsd.org/cgi/man.cgi?query=lchmod&sektion=2\"><code>lchmod(2)</code></a>. Returns <code>undefined</code>.</p>"
        },
        {
          "textRaw": "`fs.lchown(path, uid, gid, callback)`",
          "type": "method",
          "name": "lchown",
          "meta": {
            "changes": [
              {
                "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."
              }
            ]
          },
          "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>Asynchronous <a href=\"http://man7.org/linux/man-pages/man2/lchown.2.html\"><code>lchown(2)</code></a>. No arguments other than a possible exception are given\nto the completion callback.</p>"
        },
        {
          "textRaw": "`fs.lchownSync(path, uid, gid)`",
          "type": "method",
          "name": "lchownSync",
          "meta": {
            "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"
                }
              ]
            }
          ],
          "desc": "<p>Synchronous <a href=\"http://man7.org/linux/man-pages/man2/lchown.2.html\"><code>lchown(2)</code></a>. Returns <code>undefined</code>.</p>"
        },
        {
          "textRaw": "`fs.link(existingPath, newPath, callback)`",
          "type": "method",
          "name": "link",
          "meta": {
            "added": [
              "v0.1.31"
            ],
            "changes": [
              {
                "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>Asynchronous <a href=\"http://man7.org/linux/man-pages/man2/link.2.html\"><code>link(2)</code></a>. No arguments other than a possible exception are given to\nthe completion callback.</p>"
        },
        {
          "textRaw": "`fs.linkSync(existingPath, newPath)`",
          "type": "method",
          "name": "linkSync",
          "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>Synchronous <a href=\"http://man7.org/linux/man-pages/man2/link.2.html\"><code>link(2)</code></a>. Returns <code>undefined</code>.</p>"
        },
        {
          "textRaw": "`fs.lstat(path[, options], callback)`",
          "type": "method",
          "name": "lstat",
          "meta": {
            "added": [
              "v0.1.30"
            ],
            "changes": [
              {
                "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. 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."
              },
              {
                "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": "`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/lstat.2.html\"><code>lstat(2)</code></a>. The callback gets two arguments <code>(err, stats)</code> where\n<code>stats</code> is a <a href=\"fs.html#fs_class_fs_stats\"><code>fs.Stats</code></a> object. <code>lstat()</code> is identical to <code>stat()</code>,\nexcept that if <code>path</code> is a symbolic link, then the link itself is stat-ed,\nnot the file that it refers to.</p>"
        },
        {
          "textRaw": "`fs.lstatSync(path[, options])`",
          "type": "method",
          "name": "lstatSync",
          "meta": {
            "added": [
              "v0.1.30"
            ],
            "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. Support is currently still *experimental*."
              },
              {
                "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": [
            {
              "return": {
                "textRaw": "Returns: {fs.Stats}",
                "name": "return",
                "type": "fs.Stats"
              },
              "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`."
                    }
                  ]
                }
              ]
            }
          ],
          "desc": "<p>Synchronous <a href=\"http://man7.org/linux/man-pages/man2/lstat.2.html\"><code>lstat(2)</code></a>.</p>"
        },
        {
          "textRaw": "`fs.mkdir(path[, options], callback)`",
          "type": "method",
          "name": "mkdir",
          "meta": {
            "added": [
              "v0.1.8"
            ],
            "changes": [
              {
                "version": "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. 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": "`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."
                    }
                  ]
                },
                {
                  "textRaw": "`callback` {Function}",
                  "name": "callback",
                  "type": "Function",
                  "options": [
                    {
                      "textRaw": "`err` {Error}",
                      "name": "err",
                      "type": "Error"
                    }
                  ]
                }
              ]
            }
          ],
          "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>.</p>\n<p>The optional <code>options</code> argument can be an integer specifying mode (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.</p>\n<pre><code class=\"language-js\">// Creates /tmp/a/apple, regardless of whether `/tmp` and /tmp/a exist.\nfs.mkdir('/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-js\">fs.mkdir('/', { recursive: true }, (err) => {\n  // => [Error: EPERM: operation not permitted, mkdir 'C:\\']\n});\n</code></pre>\n<p>See also: <a href=\"http://man7.org/linux/man-pages/man2/mkdir.2.html\"><code>mkdir(2)</code></a>.</p>"
        },
        {
          "textRaw": "`fs.mkdirSync(path[, options])`",
          "type": "method",
          "name": "mkdirSync",
          "meta": {
            "added": [
              "v0.1.21"
            ],
            "changes": [
              {
                "version": "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. Support is currently still *experimental*."
              }
            ]
          },
          "signatures": [
            {
              "return": {
                "textRaw": "Returns: {string|undefined}",
                "name": "return",
                "type": "string|undefined"
              },
              "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."
                    }
                  ]
                }
              ]
            }
          ],
          "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=\"fs.html#fs_fs_mkdir_path_options_callback\"><code>fs.mkdir()</code></a>.</p>\n<p>See also: <a href=\"http://man7.org/linux/man-pages/man2/mkdir.2.html\"><code>mkdir(2)</code></a>.</p>"
        },
        {
          "textRaw": "`fs.mkdtemp(prefix[, options], callback)`",
          "type": "method",
          "name": "mkdtemp",
          "meta": {
            "added": [
              "v5.10.0"
            ],
            "changes": [
              {
                "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}",
                  "name": "prefix",
                  "type": "string"
                },
                {
                  "textRaw": "`options` {string|Object}",
                  "name": "options",
                  "type": "string|Object",
                  "options": [
                    {
                      "textRaw": "`encoding` {string} **Default:** `'utf8'`",
                      "name": "encoding",
                      "type": "string",
                      "default": "`'utf8'`"
                    }
                  ]
                },
                {
                  "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-js\">fs.mkdtemp(path.join(os.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('path').sep</code>).</p>\n<pre><code class=\"language-js\">// The parent directory for the new temporary directory\nconst tmpDir = os.tmpdir();\n\n// This method is *INCORRECT*:\nfs.mkdtemp(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*:\nconst { sep } = require('path');\nfs.mkdtemp(`${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.mkdtempSync(prefix[, options])`",
          "type": "method",
          "name": "mkdtempSync",
          "meta": {
            "added": [
              "v5.10.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "return": {
                "textRaw": "Returns: {string}",
                "name": "return",
                "type": "string"
              },
              "params": [
                {
                  "textRaw": "`prefix` {string}",
                  "name": "prefix",
                  "type": "string"
                },
                {
                  "textRaw": "`options` {string|Object}",
                  "name": "options",
                  "type": "string|Object",
                  "options": [
                    {
                      "textRaw": "`encoding` {string} **Default:** `'utf8'`",
                      "name": "encoding",
                      "type": "string",
                      "default": "`'utf8'`"
                    }
                  ]
                }
              ]
            }
          ],
          "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=\"fs.html#fs_fs_mkdtemp_prefix_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.open(path[, flags[, mode]], callback)`",
          "type": "method",
          "name": "open",
          "meta": {
            "added": [
              "v0.0.2"
            ],
            "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+` modes 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. Support is currently still *experimental*."
              }
            ]
          },
          "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} **Default:** `0o666` (readable and writable)",
                  "name": "mode",
                  "type": "string|integer",
                  "default": "`0o666` (readable and writable)"
                },
                {
                  "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 <a href=\"http://man7.org/linux/man-pages/man2/open.2.html\"><code>open(2)</code></a>.</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=\"fs.html#fs_fs_chmod_path_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.opendir(path[, options], callback)`",
          "type": "method",
          "name": "opendir",
          "meta": {
            "added": [
              "v12.12.0"
            ],
            "changes": [
              {
                "version": "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": "`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 <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#fs_class_fs_dir\"><code>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.opendirSync(path[, options])`",
          "type": "method",
          "name": "opendirSync",
          "meta": {
            "added": [
              "v12.12.0"
            ],
            "changes": [
              {
                "version": "v12.16.0",
                "pr-url": "https://github.com/nodejs/node/pull/30114",
                "description": "The `bufferSize` option was introduced."
              }
            ]
          },
          "signatures": [
            {
              "return": {
                "textRaw": "Returns: {fs.Dir}",
                "name": "return",
                "type": "fs.Dir"
              },
              "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."
                    }
                  ]
                }
              ]
            }
          ],
          "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#fs_class_fs_dir\"><code>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])`",
          "type": "method",
          "name": "openSync",
          "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+` modes 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. Support is currently still *experimental*."
              }
            ]
          },
          "signatures": [
            {
              "return": {
                "textRaw": "Returns: {number}",
                "name": "return",
                "type": "number"
              },
              "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`][]"
                },
                {
                  "textRaw": "`mode` {string|integer} **Default:** `0o666`",
                  "name": "mode",
                  "type": "string|integer",
                  "default": "`0o666`"
                }
              ]
            }
          ],
          "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=\"fs.html#fs_fs_open_path_flags_mode_callback\"><code>fs.open()</code></a>.</p>"
        },
        {
          "textRaw": "`fs.read(fd, buffer, offset, length, position, callback)`",
          "type": "method",
          "name": "read",
          "meta": {
            "added": [
              "v0.0.2"
            ],
            "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": "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}",
                  "name": "buffer",
                  "type": "Buffer|TypedArray|DataView"
                },
                {
                  "textRaw": "`offset` {integer}",
                  "name": "offset",
                  "type": "integer"
                },
                {
                  "textRaw": "`length` {integer}",
                  "name": "length",
                  "type": "integer"
                },
                {
                  "textRaw": "`position` {integer}",
                  "name": "position",
                  "type": "integer"
                },
                {
                  "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><code>buffer</code> is the buffer that the data (read from the fd) will be written to.</p>\n<p><code>offset</code> is the offset in the buffer to start writing at.</p>\n<p><code>length</code> is an integer specifying the number of bytes to read.</p>\n<p><code>position</code> is an argument specifying where to begin reading from in the file.\nIf <code>position</code> is <code>null</code>, data will be read from the current file position,\nand the file position will be updated.\nIf <code>position</code> is an integer, the file position will remain unchanged.</p>\n<p>The callback is given the three arguments, <code>(err, bytesRead, buffer)</code>.</p>\n<p>If this method is invoked as its <a href=\"util.html#util_util_promisify_original\"><code>util.promisify()</code></a>ed version, it returns\na <code>Promise</code> for an <code>Object</code> with <code>bytesRead</code> and <code>buffer</code> properties.</p>"
        },
        {
          "textRaw": "`fs.read(fd, [options,] callback)`",
          "type": "method",
          "name": "read",
          "meta": {
            "added": [
              "v12.17.0"
            ],
            "changes": [
              {
                "version": "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.length`",
                      "name": "length",
                      "type": "integer",
                      "default": "`buffer.length`"
                    },
                    {
                      "textRaw": "`position` {integer} **Default:** `null`",
                      "name": "position",
                      "type": "integer",
                      "default": "`null`"
                    }
                  ]
                },
                {
                  "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 above <code>fs.read</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>"
        },
        {
          "textRaw": "`fs.readdir(path[, options], callback)`",
          "type": "method",
          "name": "readdir",
          "meta": {
            "added": [
              "v0.1.8"
            ],
            "changes": [
              {
                "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. 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."
              },
              {
                "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": "`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>Asynchronous <a href=\"http://man7.org/linux/man-pages/man3/readdir.3.html\"><code>readdir(3)</code></a>. Reads the contents of a directory.\nThe callback gets two arguments <code>(err, files)</code> where <code>files</code> is an array of\nthe names of the files in the directory excluding <code>'.'</code> and <code>'..'</code>.</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 <code>Buffer</code> 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#fs_class_fs_dirent\"><code>fs.Dirent</code></a> objects.</p>"
        },
        {
          "textRaw": "`fs.readdirSync(path[, options])`",
          "type": "method",
          "name": "readdirSync",
          "meta": {
            "added": [
              "v0.1.21"
            ],
            "changes": [
              {
                "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. Support is currently still *experimental*."
              }
            ]
          },
          "signatures": [
            {
              "return": {
                "textRaw": "Returns: {string[]|Buffer[]|fs.Dirent[]}",
                "name": "return",
                "type": "string[]|Buffer[]|fs.Dirent[]"
              },
              "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`"
                    }
                  ]
                }
              ]
            }
          ],
          "desc": "<p>Synchronous <a href=\"http://man7.org/linux/man-pages/man3/readdir.3.html\"><code>readdir(3)</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 for\nthe filenames returned. If the <code>encoding</code> is set to <code>'buffer'</code>,\nthe filenames returned will be passed as <code>Buffer</code> objects.</p>\n<p>If <code>options.withFileTypes</code> is set to <code>true</code>, the result will contain\n<a href=\"fs.html#fs_class_fs_dirent\"><code>fs.Dirent</code></a> objects.</p>"
        },
        {
          "textRaw": "`fs.readFile(path[, options], callback)`",
          "type": "method",
          "name": "readFile",
          "meta": {
            "added": [
              "v0.1.29"
            ],
            "changes": [
              {
                "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. 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."
              },
              {
                "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": "`callback` {Function}",
                  "name": "callback",
                  "type": "Function",
                  "options": [
                    {
                      "textRaw": "`err` {Error}",
                      "name": "err",
                      "type": "Error"
                    },
                    {
                      "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-js\">fs.readFile('/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-js\">fs.readFile('/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=\"fs.html#fs_fs_readfilesync_path_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-js\">// macOS, Linux, and Windows\nfs.readFile('&#x3C;directory>', (err, data) => {\n  // => [Error: EISDIR: illegal operation on a directory, read &#x3C;directory>]\n});\n\n//  FreeBSD\nfs.readFile('&#x3C;directory>', (err, data) => {\n  // => null, &#x3C;data>\n});\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>",
          "modules": [
            {
              "textRaw": "File descriptors",
              "name": "file_descriptors",
              "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>",
              "type": "module",
              "displayName": "File descriptors"
            }
          ]
        },
        {
          "textRaw": "`fs.readFileSync(path[, options])`",
          "type": "method",
          "name": "readFileSync",
          "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. Support is currently still *experimental*."
              },
              {
                "version": "v5.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/3163",
                "description": "The `path` parameter can be a file descriptor now."
              }
            ]
          },
          "signatures": [
            {
              "return": {
                "textRaw": "Returns: {string|Buffer}",
                "name": "return",
                "type": "string|Buffer"
              },
              "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`][]."
                    }
                  ]
                }
              ]
            }
          ],
          "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=\"fs.html#fs_fs_readfile_path_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=\"fs.html#fs_fs_readfile_path_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-js\">// macOS, Linux, and Windows\nfs.readFileSync('&#x3C;directory>');\n// => [Error: EISDIR: illegal operation on a directory, read &#x3C;directory>]\n\n//  FreeBSD\nfs.readFileSync('&#x3C;directory>'); // => &#x3C;data>\n</code></pre>"
        },
        {
          "textRaw": "`fs.readlink(path[, options], callback)`",
          "type": "method",
          "name": "readlink",
          "meta": {
            "added": [
              "v0.1.31"
            ],
            "changes": [
              {
                "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. 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": "`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": "`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>Asynchronous <a href=\"http://man7.org/linux/man-pages/man2/readlink.2.html\"><code>readlink(2)</code></a>. The callback gets two arguments <code>(err, linkString)</code>.</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 <code>Buffer</code> object.</p>"
        },
        {
          "textRaw": "`fs.readlinkSync(path[, options])`",
          "type": "method",
          "name": "readlinkSync",
          "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. Support is currently still *experimental*."
              }
            ]
          },
          "signatures": [
            {
              "return": {
                "textRaw": "Returns: {string|Buffer}",
                "name": "return",
                "type": "string|Buffer"
              },
              "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'`"
                    }
                  ]
                }
              ]
            }
          ],
          "desc": "<p>Synchronous <a href=\"http://man7.org/linux/man-pages/man2/readlink.2.html\"><code>readlink(2)</code></a>. Returns the symbolic link's string value.</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 <code>Buffer</code> object.</p>"
        },
        {
          "textRaw": "`fs.readSync(fd, buffer, offset, length, position)`",
          "type": "method",
          "name": "readSync",
          "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": [
            {
              "return": {
                "textRaw": "Returns: {number}",
                "name": "return",
                "type": "number"
              },
              "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}",
                  "name": "position",
                  "type": "integer"
                }
              ]
            }
          ],
          "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=\"fs.html#fs_fs_read_fd_buffer_offset_length_position_callback\"><code>fs.read()</code></a>.</p>"
        },
        {
          "textRaw": "`fs.readSync(fd, buffer, [options])`",
          "type": "method",
          "name": "readSync",
          "meta": {
            "added": [
              "v12.17.0"
            ],
            "changes": [
              {
                "version": "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": [
            {
              "return": {
                "textRaw": "Returns: {number}",
                "name": "return",
                "type": "number"
              },
              "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.length`",
                      "name": "length",
                      "type": "integer",
                      "default": "`buffer.length`"
                    },
                    {
                      "textRaw": "`position` {integer} **Default:** `null`",
                      "name": "position",
                      "type": "integer",
                      "default": "`null`"
                    }
                  ]
                }
              ]
            }
          ],
          "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=\"fs.html#fs_fs_read_fd_buffer_offset_length_position_callback\"><code>fs.read()</code></a>.</p>"
        },
        {
          "textRaw": "`fs.readv(fd, buffers[, position], callback)`",
          "type": "method",
          "name": "readv",
          "meta": {
            "added": [
              "v12.17.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`fd` {integer}",
                  "name": "fd",
                  "type": "integer"
                },
                {
                  "textRaw": "`buffers` {ArrayBufferView[]}",
                  "name": "buffers",
                  "type": "ArrayBufferView[]"
                },
                {
                  "textRaw": "`position` {integer}",
                  "name": "position",
                  "type": "integer"
                },
                {
                  "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#util_util_promisify_original\"><code>util.promisify()</code></a>ed version, it returns\na <code>Promise</code> for an <code>Object</code> with <code>bytesRead</code> and <code>buffers</code> properties.</p>"
        },
        {
          "textRaw": "`fs.readvSync(fd, buffers[, position])`",
          "type": "method",
          "name": "readvSync",
          "meta": {
            "added": [
              "v12.17.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "return": {
                "textRaw": "Returns: {number} The number of bytes read.",
                "name": "return",
                "type": "number",
                "desc": "The number of bytes read."
              },
              "params": [
                {
                  "textRaw": "`fd` {integer}",
                  "name": "fd",
                  "type": "integer"
                },
                {
                  "textRaw": "`buffers` {ArrayBufferView[]}",
                  "name": "buffers",
                  "type": "ArrayBufferView[]"
                },
                {
                  "textRaw": "`position` {integer}",
                  "name": "position",
                  "type": "integer"
                }
              ]
            }
          ],
          "desc": "<p>For detailed information, see the documentation of the asynchronous version of\nthis API: <a href=\"fs.html#fs_fs_readv_fd_buffers_position_callback\"><code>fs.readv()</code></a>.</p>"
        },
        {
          "textRaw": "`fs.realpath(path[, options], callback)`",
          "type": "method",
          "name": "realpath",
          "meta": {
            "added": [
              "v0.1.31"
            ],
            "changes": [
              {
                "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. 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."
              },
              {
                "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'`"
                    }
                  ]
                },
                {
                  "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 <code>Buffer</code> 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>"
        },
        {
          "textRaw": "`fs.realpath.native(path[, options], callback)`",
          "type": "method",
          "name": "native",
          "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'`"
                    }
                  ]
                },
                {
                  "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 <code>Buffer</code> 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.realpathSync(path[, options])`",
          "type": "method",
          "name": "realpathSync",
          "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. Support is currently still *experimental*."
              },
              {
                "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": [
            {
              "return": {
                "textRaw": "Returns: {string|Buffer}",
                "name": "return",
                "type": "string|Buffer"
              },
              "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'`"
                    }
                  ]
                }
              ]
            }
          ],
          "desc": "<p>Returns the resolved pathname.</p>\n<p>For detailed information, see the documentation of the asynchronous version of\nthis API: <a href=\"fs.html#fs_fs_realpath_path_options_callback\"><code>fs.realpath()</code></a>.</p>"
        },
        {
          "textRaw": "`fs.realpathSync.native(path[, options])`",
          "type": "method",
          "name": "native",
          "meta": {
            "added": [
              "v9.2.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "return": {
                "textRaw": "Returns: {string|Buffer}",
                "name": "return",
                "type": "string|Buffer"
              },
              "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'`"
                    }
                  ]
                }
              ]
            }
          ],
          "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 <code>Buffer</code> 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)`",
          "type": "method",
          "name": "rename",
          "meta": {
            "added": [
              "v0.0.2"
            ],
            "changes": [
              {
                "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-js\">fs.rename('oldFile.txt', 'newFile.txt', (err) => {\n  if (err) throw err;\n  console.log('Rename complete!');\n});\n</code></pre>"
        },
        {
          "textRaw": "`fs.renameSync(oldPath, newPath)`",
          "type": "method",
          "name": "renameSync",
          "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>Synchronous <a href=\"http://man7.org/linux/man-pages/man2/rename.2.html\"><code>rename(2)</code></a>. Returns <code>undefined</code>.</p>"
        },
        {
          "textRaw": "`fs.rmdir(path[, options], callback)`",
          "type": "method",
          "name": "rmdir",
          "meta": {
            "added": [
              "v0.0.2"
            ],
            "changes": [
              {
                "version": "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. 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."
              }
            ]
          },
          "stability": 1,
          "stabilityText": "Recursive removal is experimental.",
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`path` {string|Buffer|URL}",
                  "name": "path",
                  "type": "string|Buffer|URL"
                },
                {
                  "textRaw": "`options` {Object}",
                  "name": "options",
                  "type": "Object",
                  "options": [
                    {
                      "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` ms 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` ms 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, errors are not reported if `path` does not exist, and operations are retried on failure. **Default:** `false`.",
                      "name": "recursive",
                      "type": "boolean",
                      "default": "`false`",
                      "desc": "If `true`, perform a recursive directory removal. In recursive mode, errors are not reported if `path` does not exist, and 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`."
                    }
                  ]
                },
                {
                  "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>"
        },
        {
          "textRaw": "`fs.rmdirSync(path[, options])`",
          "type": "method",
          "name": "rmdirSync",
          "meta": {
            "added": [
              "v0.1.21"
            ],
            "changes": [
              {
                "version": "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. Support is currently still *experimental*."
              }
            ]
          },
          "stability": 1,
          "stabilityText": "Recursive removal is experimental.",
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`path` {string|Buffer|URL}",
                  "name": "path",
                  "type": "string|Buffer|URL"
                },
                {
                  "textRaw": "`options` {Object}",
                  "name": "options",
                  "type": "Object",
                  "options": [
                    {
                      "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` ms 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` ms 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, errors are not reported if `path` does not exist, and operations are retried on failure. **Default:** `false`.",
                      "name": "recursive",
                      "type": "boolean",
                      "default": "`false`",
                      "desc": "If `true`, perform a recursive directory removal. In recursive mode, errors are not reported if `path` does not exist, and 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`."
                    }
                  ]
                }
              ]
            }
          ],
          "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>"
        },
        {
          "textRaw": "`fs.stat(path[, options], callback)`",
          "type": "method",
          "name": "stat",
          "meta": {
            "added": [
              "v0.0.2"
            ],
            "changes": [
              {
                "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. 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."
              },
              {
                "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": "`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#fs_class_fs_stats\"><code>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#errors_common_system_errors\">Common System Errors</a>.</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=\"fs.html#fs_fs_access_path_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-js\">const fs = require('fs');\n\nconst pathsToCheck = ['./txtDir', './txtDir/file.txt'];\n\nfor (let i = 0; i &#x3C; pathsToCheck.length; i++) {\n  fs.stat(pathsToCheck[i], function(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}\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}\n</code></pre>"
        },
        {
          "textRaw": "`fs.statSync(path[, options])`",
          "type": "method",
          "name": "statSync",
          "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. Support is currently still *experimental*."
              },
              {
                "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": [
            {
              "return": {
                "textRaw": "Returns: {fs.Stats}",
                "name": "return",
                "type": "fs.Stats"
              },
              "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`."
                    }
                  ]
                }
              ]
            }
          ],
          "desc": "<p>Synchronous <a href=\"http://man7.org/linux/man-pages/man2/stat.2.html\"><code>stat(2)</code></a>.</p>"
        },
        {
          "textRaw": "`fs.symlink(target, path[, type], callback)`",
          "type": "method",
          "name": "symlink",
          "meta": {
            "added": [
              "v0.1.31"
            ],
            "changes": [
              {
                "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*."
              },
              {
                "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`"
              }
            ]
          },
          "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}",
                  "name": "type",
                  "type": "string"
                },
                {
                  "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/symlink.2.html\"><code>symlink(2)</code></a> which creates the link called <code>path</code> pointing to\n<code>target</code>. No arguments other than a possible exception are given to the\ncompletion callback.</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\nnot set, Node.js will autodetect <code>target</code> type and use <code>'file'</code> or <code>'dir'</code>. If\nthe <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.</p>\n<p>Relative targets are relative to the link’s parent directory.</p>\n<pre><code class=\"language-js\">fs.symlink('./mew', './example/mewtwo', callback);\n</code></pre>\n<p>The above example creates a symbolic link <code>mewtwo</code> in the <code>example</code> which points\nto <code>mew</code> in the same directory:</p>\n<pre><code class=\"language-bash\">$ tree example/\nexample/\n├── mew\n└── mewtwo -> ./mew\n</code></pre>"
        },
        {
          "textRaw": "`fs.symlinkSync(target, path[, type])`",
          "type": "method",
          "name": "symlinkSync",
          "meta": {
            "added": [
              "v0.1.31"
            ],
            "changes": [
              {
                "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*."
              },
              {
                "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`"
              }
            ]
          },
          "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}",
                  "name": "type",
                  "type": "string"
                }
              ]
            }
          ],
          "desc": "<p>Returns <code>undefined</code>.</p>\n<p>For detailed information, see the documentation of the asynchronous version of\nthis API: <a href=\"fs.html#fs_fs_symlink_target_path_type_callback\"><code>fs.symlink()</code></a>.</p>"
        },
        {
          "textRaw": "`fs.truncate(path[, len], callback)`",
          "type": "method",
          "name": "truncate",
          "meta": {
            "added": [
              "v0.8.6"
            ],
            "changes": [
              {
                "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`"
                },
                {
                  "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/truncate.2.html\"><code>truncate(2)</code></a>. 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<p>Passing a file descriptor is deprecated and may result in an error being thrown\nin the future.</p>"
        },
        {
          "textRaw": "`fs.truncateSync(path[, len])`",
          "type": "method",
          "name": "truncateSync",
          "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`"
                }
              ]
            }
          ],
          "desc": "<p>Synchronous <a href=\"http://man7.org/linux/man-pages/man2/truncate.2.html\"><code>truncate(2)</code></a>. 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.unlink(path, callback)`",
          "type": "method",
          "name": "unlink",
          "meta": {
            "added": [
              "v0.0.2"
            ],
            "changes": [
              {
                "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. 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": "`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-js\">// Assuming that 'path/file.txt' is a regular file.\nfs.unlink('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=\"fs.html#fs_fs_rmdir_path_options_callback\"><code>fs.rmdir()</code></a>.</p>\n<p>See also: <a href=\"http://man7.org/linux/man-pages/man2/unlink.2.html\"><code>unlink(2)</code></a>.</p>"
        },
        {
          "textRaw": "`fs.unlinkSync(path)`",
          "type": "method",
          "name": "unlinkSync",
          "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. Support is currently still *experimental*."
              }
            ]
          },
          "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.unwatchFile(filename[, listener])`",
          "type": "method",
          "name": "unwatchFile",
          "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()`"
                }
              ]
            }
          ],
          "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=\"fs.html#fs_fs_watch_filename_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)`",
          "type": "method",
          "name": "utimes",
          "meta": {
            "added": [
              "v0.4.2"
            ],
            "changes": [
              {
                "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. 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."
              },
              {
                "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.utimesSync(path, atime, mtime)`",
          "type": "method",
          "name": "utimesSync",
          "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. Support is currently still *experimental*."
              },
              {
                "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"
                }
              ]
            }
          ],
          "desc": "<p>Returns <code>undefined</code>.</p>\n<p>For detailed information, see the documentation of the asynchronous version of\nthis API: <a href=\"fs.html#fs_fs_utimes_path_atime_mtime_callback\"><code>fs.utimes()</code></a>.</p>"
        },
        {
          "textRaw": "`fs.watch(filename[, options][, listener])`",
          "type": "method",
          "name": "watch",
          "meta": {
            "added": [
              "v0.5.10"
            ],
            "changes": [
              {
                "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. Support is currently still *experimental*."
              },
              {
                "version": "v7.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/7831",
                "description": "The passed `options` object will never be modified."
              }
            ]
          },
          "signatures": [
            {
              "return": {
                "textRaw": "Returns: {fs.FSWatcher}",
                "name": "return",
                "type": "fs.FSWatcher"
              },
              "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": "`listener` {Function|undefined} **Default:** `undefined`",
                  "name": "listener",
                  "type": "Function|undefined",
                  "default": "`undefined`",
                  "options": [
                    {
                      "textRaw": "`eventType` {string}",
                      "name": "eventType",
                      "type": "string"
                    },
                    {
                      "textRaw": "`filename` {string|Buffer}",
                      "name": "filename",
                      "type": "string|Buffer"
                    }
                  ]
                }
              ]
            }
          ],
          "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#fs_class_fs_fswatcher\"><code>fs.FSWatcher</code></a>, but it is not the same thing as the <code>'change'</code> value of\n<code>eventType</code>.</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>The recursive option is only supported on macOS and Windows.</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>",
              "miscs": [
                {
                  "textRaw": "Availability",
                  "name": "Availability",
                  "type": "misc",
                  "desc": "<p>This feature depends on the underlying operating system providing a way\nto be notified of filesystem changes.</p>\n<ul>\n<li>On Linux systems, this uses <a href=\"http://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://www.ibm.com/developerworks/aix/library/au-aix_event_infrastructure/\"><code>AHAFS</code></a>, which must be enabled.</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 thrown 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-js\">fs.watch('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)`",
          "type": "method",
          "name": "watchFile",
          "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. Support is currently still *experimental*."
              }
            ]
          },
          "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`"
                    }
                  ]
                },
                {
                  "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"
                    }
                  ]
                }
              ]
            }
          ],
          "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-js\">fs.watchFile('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.mtime</code> and <code>prev.mtime</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=\"fs.html#fs_fs_watch_filename_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 <code>previousStat</code> reported in the second callback event (the file's\nreappearance) will be the same as the <code>previousStat</code> of the first callback\nevent (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)`",
          "type": "method",
          "name": "write",
          "meta": {
            "added": [
              "v0.0.2"
            ],
            "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": "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}",
                  "name": "offset",
                  "type": "integer"
                },
                {
                  "textRaw": "`length` {integer}",
                  "name": "length",
                  "type": "integer"
                },
                {
                  "textRaw": "`position` {integer}",
                  "name": "position",
                  "type": "integer"
                },
                {
                  "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#util_util_promisify_original\"><code>util.promisify()</code></a>ed version, it returns\na <code>Promise</code> 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=\"fs.html#fs_fs_createwritestream_path_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, string[, position[, encoding]], callback)`",
          "type": "method",
          "name": "write",
          "meta": {
            "added": [
              "v0.11.5"
            ],
            "changes": [
              {
                "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}",
                  "name": "position",
                  "type": "integer"
                },
                {
                  "textRaw": "`encoding` {string} **Default:** `'utf8'`",
                  "name": "encoding",
                  "type": "string",
                  "default": "`'utf8'`"
                },
                {
                  "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, then\nthe value will be coerced to one.</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#buffer_class_method_buffer_bytelength_string_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=\"fs.html#fs_fs_createwritestream_path_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)`",
          "type": "method",
          "name": "writeFile",
          "meta": {
            "added": [
              "v0.1.29"
            ],
            "changes": [
              {
                "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": "`callback` {Function}",
                  "name": "callback",
                  "type": "Function",
                  "options": [
                    {
                      "textRaw": "`err` {Error}",
                      "name": "err",
                      "type": "Error"
                    }
                  ]
                }
              ]
            }
          ],
          "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<pre><code class=\"language-js\">const data = new Uint8Array(Buffer.from('Hello Node.js'));\nfs.writeFile('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-js\">fs.writeFile('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=\"fs.html#fs_fs_createwritestream_path_options\"><code>fs.createWriteStream()</code></a> is\nrecommended.</p>",
          "modules": [
            {
              "textRaw": "Using `fs.writeFile()` with file descriptors",
              "name": "using_`fs.writefile()`_with_file_descriptors",
              "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-js\">fs.write(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> may write only part of the buffer and will need to be\nretried to write the remaining data, whereas <code>fs.writeFile()</code> will retry 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>",
              "type": "module",
              "displayName": "Using `fs.writeFile()` with file descriptors"
            }
          ]
        },
        {
          "textRaw": "`fs.writeFileSync(file, data[, options])`",
          "type": "method",
          "name": "writeFileSync",
          "meta": {
            "added": [
              "v0.1.29"
            ],
            "changes": [
              {
                "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`][]."
                    }
                  ]
                }
              ]
            }
          ],
          "desc": "<p>Returns <code>undefined</code>.</p>\n<p>For detailed information, see the documentation of the asynchronous version of\nthis API: <a href=\"fs.html#fs_fs_writefile_file_data_options_callback\"><code>fs.writeFile()</code></a>.</p>"
        },
        {
          "textRaw": "`fs.writeSync(fd, buffer[, offset[, length[, position]]])`",
          "type": "method",
          "name": "writeSync",
          "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": "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": [
            {
              "return": {
                "textRaw": "Returns: {number} The number of bytes written.",
                "name": "return",
                "type": "number",
                "desc": "The number of bytes written."
              },
              "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}",
                  "name": "position",
                  "type": "integer"
                }
              ]
            }
          ],
          "desc": "<p>For detailed information, see the documentation of the asynchronous version of\nthis API: <a href=\"fs.html#fs_fs_write_fd_buffer_offset_length_position_callback\"><code>fs.write(fd, buffer...)</code></a>.</p>"
        },
        {
          "textRaw": "`fs.writeSync(fd, string[, position[, encoding]])`",
          "type": "method",
          "name": "writeSync",
          "meta": {
            "added": [
              "v0.11.5"
            ],
            "changes": [
              {
                "version": "v7.2.0",
                "pr-url": "https://github.com/nodejs/node/pull/7856",
                "description": "The `position` parameter is optional now."
              }
            ]
          },
          "signatures": [
            {
              "return": {
                "textRaw": "Returns: {number} The number of bytes written.",
                "name": "return",
                "type": "number",
                "desc": "The number of bytes written."
              },
              "params": [
                {
                  "textRaw": "`fd` {integer}",
                  "name": "fd",
                  "type": "integer"
                },
                {
                  "textRaw": "`string` {string}",
                  "name": "string",
                  "type": "string"
                },
                {
                  "textRaw": "`position` {integer}",
                  "name": "position",
                  "type": "integer"
                },
                {
                  "textRaw": "`encoding` {string}",
                  "name": "encoding",
                  "type": "string"
                }
              ]
            }
          ],
          "desc": "<p>For detailed information, see the documentation of the asynchronous version of\nthis API: <a href=\"fs.html#fs_fs_write_fd_string_position_encoding_callback\"><code>fs.write(fd, string...)</code></a>.</p>"
        },
        {
          "textRaw": "`fs.writev(fd, buffers[, position], callback)`",
          "type": "method",
          "name": "writev",
          "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}",
                  "name": "position",
                  "type": "integer"
                },
                {
                  "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#util_util_promisify_original\"><code>util.promisify()</code></a>ed, it returns a <code>Promise</code> 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=\"fs.html#fs_fs_createwritestream_path_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>"
        },
        {
          "textRaw": "`fs.writevSync(fd, buffers[, position])`",
          "type": "method",
          "name": "writevSync",
          "meta": {
            "added": [
              "v12.9.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "return": {
                "textRaw": "Returns: {number} The number of bytes written.",
                "name": "return",
                "type": "number",
                "desc": "The number of bytes written."
              },
              "params": [
                {
                  "textRaw": "`fd` {integer}",
                  "name": "fd",
                  "type": "integer"
                },
                {
                  "textRaw": "`buffers` {ArrayBufferView[]}",
                  "name": "buffers",
                  "type": "ArrayBufferView[]"
                },
                {
                  "textRaw": "`position` {integer}",
                  "name": "position",
                  "type": "integer"
                }
              ]
            }
          ],
          "desc": "<p>For detailed information, see the documentation of the asynchronous version of\nthis API: <a href=\"fs.html#fs_fs_writev_fd_buffers_position_callback\"><code>fs.writev()</code></a>.</p>"
        }
      ],
      "properties": [
        {
          "textRaw": "`constants` {Object}",
          "type": "Object",
          "name": "constants",
          "desc": "<p>Returns an object containing commonly used constants for file system\noperations. The specific constants currently defined are described in\n<a href=\"fs.html#fs_fs_constants_1\">FS constants</a>.</p>"
        }
      ],
      "type": "module",
      "displayName": "fs"
    },
    {
      "textRaw": "HTTP",
      "name": "http",
      "introduced_in": "v0.10.0",
      "stability": 2,
      "stabilityText": "Stable",
      "desc": "<p>To use the HTTP server and client one must <code>require('http')</code>.</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<!-- eslint-skip -->\n<pre><code class=\"language-js\">{ 'content-length': '123',\n  'content-type': 'text/plain',\n  'connection': 'keep-alive',\n  'host': 'mysite.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=\"http.html#http_message_headers\"><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<!-- eslint-disable semi -->\n<pre><code class=\"language-js\">[ 'ConTent-Length', '123456',\n  'content-LENGTH', '123',\n  'content-type', 'text/plain',\n  'CONNECTION', 'keep-alive',\n  'Host', 'mysite.com',\n  'accepT', '*/*' ]\n</code></pre>",
      "classes": [
        {
          "textRaw": "Class: `http.Agent`",
          "type": "class",
          "name": "http.Agent",
          "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=\"http.html#http_new_agent_options\">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#net_socket_unref\"><code>socket.unref()</code></a>).</p>\n<p>It is good practice, to <a href=\"http.html#http_agent_destroy\"><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>",
          "methods": [
            {
              "textRaw": "`agent.createConnection(options[, callback])`",
              "type": "method",
              "name": "createConnection",
              "meta": {
                "added": [
                  "v0.11.4"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {stream.Duplex}",
                    "name": "return",
                    "type": "stream.Duplex"
                  },
                  "params": [
                    {
                      "textRaw": "`options` {Object} Options containing connection details. Check [`net.createConnection()`][] for the format of the options",
                      "name": "options",
                      "type": "Object",
                      "desc": "Options containing connection details. Check [`net.createConnection()`][] for the format of the options"
                    },
                    {
                      "textRaw": "`callback` {Function} Callback function that receives the created socket",
                      "name": "callback",
                      "type": "Function",
                      "desc": "Callback function that receives the created socket"
                    }
                  ]
                }
              ],
              "desc": "<p>Produces a socket/stream to be used for HTTP requests.</p>\n<p>By default, this function is the same as <a href=\"net.html#net_net_createconnection_options_connectlistener\"><code>net.createConnection()</code></a>. However,\ncustom agents may override this method in case greater flexibility is desired.</p>\n<p>A socket/stream can be supplied in one of two ways: by returning the\nsocket/stream from this function, or by passing the socket/stream to <code>callback</code>.</p>\n<p>This method is guaranteed to return an instance of the <a href=\"net.html#net_class_net_socket\" class=\"type\">&lt;net.Socket&gt;</a> class,\na subclass of <a href=\"stream.html#stream_class_stream_duplex\" class=\"type\">&lt;stream.Duplex&gt;</a>, unless the user specifies a socket\ntype other than <a href=\"net.html#net_class_net_socket\" class=\"type\">&lt;net.Socket&gt;</a>.</p>\n<p><code>callback</code> has a signature of <code>(err, stream)</code>.</p>"
            },
            {
              "textRaw": "`agent.keepSocketAlive(socket)`",
              "type": "method",
              "name": "keepSocketAlive",
              "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#net_class_net_socket\" class=\"type\">&lt;net.Socket&gt;</a>, a subclass of\n<a href=\"stream.html#stream_class_stream_duplex\" class=\"type\">&lt;stream.Duplex&gt;</a>.</p>"
            },
            {
              "textRaw": "`agent.reuseSocket(socket, request)`",
              "type": "method",
              "name": "reuseSocket",
              "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#net_class_net_socket\" class=\"type\">&lt;net.Socket&gt;</a>, a subclass of\n<a href=\"stream.html#stream_class_stream_duplex\" class=\"type\">&lt;stream.Duplex&gt;</a>.</p>"
            },
            {
              "textRaw": "`agent.destroy()`",
              "type": "method",
              "name": "destroy",
              "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 will no longer be used. Otherwise,\nsockets may hang open for quite a long time before the server\nterminates them.</p>"
            },
            {
              "textRaw": "`agent.getName(options)`",
              "type": "method",
              "name": "getName",
              "meta": {
                "added": [
                  "v0.11.4"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {string}",
                    "name": "return",
                    "type": "string"
                  },
                  "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`."
                        }
                      ]
                    }
                  ]
                }
              ],
              "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": "`freeSockets` {Object}",
              "type": "Object",
              "name": "freeSockets",
              "meta": {
                "added": [
                  "v0.11.4"
                ],
                "changes": []
              },
              "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": "`maxFreeSockets` {number}",
              "type": "number",
              "name": "maxFreeSockets",
              "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": "`maxSockets` {number}",
              "type": "number",
              "name": "maxSockets",
              "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=\"http.html#http_agent_getname_options\"><code>agent.getName()</code></a>.</p>"
            },
            {
              "textRaw": "`requests` {Object}",
              "type": "Object",
              "name": "requests",
              "meta": {
                "added": [
                  "v0.5.9"
                ],
                "changes": []
              },
              "desc": "<p>An object which contains queues of requests that have not yet been assigned to\nsockets. Do not modify.</p>"
            },
            {
              "textRaw": "`sockets` {Object}",
              "type": "Object",
              "name": "sockets",
              "meta": {
                "added": [
                  "v0.3.6"
                ],
                "changes": []
              },
              "desc": "<p>An object which contains arrays of sockets currently in use by the\nagent. Do not modify.</p>"
            }
          ],
          "signatures": [
            {
              "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](net.html#net_socket_setkeepalive_enable_initialdelay) 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](net.html#net_socket_setkeepalive_enable_initialdelay) for TCP Keep-Alive packets. Ignored when the `keepAlive` option is `false` or `undefined`."
                    },
                    {
                      "textRaw": "`maxSockets` {number} Maximum number of sockets to allow per host. Each request will use a new socket until the maximum is reached. **Default:** `Infinity`.",
                      "name": "maxSockets",
                      "type": "number",
                      "default": "`Infinity`",
                      "desc": "Maximum number of sockets to allow per host. Each request will use a new socket until the maximum is reached."
                    },
                    {
                      "textRaw": "`maxFreeSockets` {number} Maximum number of sockets 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 to leave open in a free state. Only relevant if `keepAlive` is set to `true`."
                    },
                    {
                      "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."
                    }
                  ]
                }
              ],
              "desc": "<p><code>options</code> in <a href=\"net.html#net_socket_connect_options_connectlistener\"><code>socket.connect()</code></a> are also supported.</p>\n<p>The default <a href=\"http.html#http_http_globalagent\"><code>http.globalAgent</code></a> that is used by <a href=\"http.html#http_http_request_options_callback\"><code>http.request()</code></a> has all\nof these values set to their respective defaults.</p>\n<p>To configure any of them, a custom <a href=\"http.html#http_class_http_agent\"><code>http.Agent</code></a> instance must be created.</p>\n<pre><code class=\"language-js\">const http = require('http');\nconst keepAliveAgent = new http.Agent({ keepAlive: true });\noptions.agent = keepAliveAgent;\nhttp.request(options, onResponseCallback);\n</code></pre>"
            }
          ]
        },
        {
          "textRaw": "Class: `http.ClientRequest`",
          "type": "class",
          "name": "http.ClientRequest",
          "meta": {
            "added": [
              "v0.1.17"
            ],
            "changes": []
          },
          "desc": "<ul>\n<li>Extends: <a href=\"stream.html#stream_stream\" class=\"type\">&lt;Stream&gt;</a></li>\n</ul>\n<p>This object is created internally and returned from <a href=\"http.html#http_http_request_options_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=\"http.html#http_request_setheader_name_value\"><code>setHeader(name, value)</code></a>,\n<a href=\"http.html#http_request_getheader_name\"><code>getHeader(name)</code></a>, <a href=\"http.html#http_request_removeheader_name\"><code>removeHeader(name)</code></a> API. The actual header will\nbe sent along with the first data chunk or when calling <a href=\"http.html#http_request_end_data_encoding_callback\"><code>request.end()</code></a>.</p>\n<p>To get the response, add a listener for <a href=\"http.html#http_event_response\"><code>'response'</code></a> to the request object.\n<a href=\"http.html#http_event_response\"><code>'response'</code></a> will be emitted from the request object when the response\nheaders have been received. The <a href=\"http.html#http_event_response\"><code>'response'</code></a> event is executed with one\nargument which is an instance of <a href=\"http.html#http_class_http_incomingmessage\"><code>http.IncomingMessage</code></a>.</p>\n<p>During the <a href=\"http.html#http_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=\"http.html#http_event_response\"><code>'response'</code></a> handler is added, then the response will be\nentirely discarded. However, if a <a href=\"http.html#http_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>Unlike the <code>request</code> object, if the response closes prematurely, the\n<code>response</code> object does not emit an <code>'error'</code> event but instead emits the\n<code>'aborted'</code> event.</p>\n<p>Node.js does not check whether Content-Length and the length of the\nbody which has been transmitted are equal or not.</p>",
          "events": [
            {
              "textRaw": "Event: `'abort'`",
              "type": "event",
              "name": "abort",
              "meta": {
                "added": [
                  "v1.4.1"
                ],
                "changes": []
              },
              "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: `'connect'`",
              "type": "event",
              "name": "connect",
              "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#net_class_net_socket\" class=\"type\">&lt;net.Socket&gt;</a> class,\na subclass of <a href=\"stream.html#stream_class_stream_duplex\" class=\"type\">&lt;stream.Duplex&gt;</a>, unless the user specifies a socket\ntype other than <a href=\"net.html#net_class_net_socket\" class=\"type\">&lt;net.Socket&gt;</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-js\">const http = require('http');\nconst net = require('net');\nconst { URL } = require('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'`",
              "type": "event",
              "name": "continue",
              "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: `'information'`",
              "type": "event",
              "name": "information",
              "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-js\">const http = require('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=\"http.html#http_event_upgrade\"><code>'upgrade'</code></a> event instead.</p>"
            },
            {
              "textRaw": "Event: `'response'`",
              "type": "event",
              "name": "response",
              "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'`",
              "type": "event",
              "name": "socket",
              "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#net_class_net_socket\" class=\"type\">&lt;net.Socket&gt;</a> class,\na subclass of <a href=\"stream.html#stream_class_stream_duplex\" class=\"type\">&lt;stream.Duplex&gt;</a>, unless the user specifies a socket\ntype other than <a href=\"net.html#net_class_net_socket\" class=\"type\">&lt;net.Socket&gt;</a>.</p>"
            },
            {
              "textRaw": "Event: `'timeout'`",
              "type": "event",
              "name": "timeout",
              "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 aborted manually.</p>\n<p>See also: <a href=\"http.html#http_request_settimeout_timeout_callback\"><code>request.setTimeout()</code></a>.</p>"
            },
            {
              "textRaw": "Event: `'upgrade'`",
              "type": "event",
              "name": "upgrade",
              "meta": {
                "added": [
                  "v0.1.94"
                ],
                "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 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#net_class_net_socket\" class=\"type\">&lt;net.Socket&gt;</a> class,\na subclass of <a href=\"stream.html#stream_class_stream_duplex\" class=\"type\">&lt;stream.Duplex&gt;</a>, unless the user specifies a socket\ntype other than <a href=\"net.html#net_class_net_socket\" class=\"type\">&lt;net.Socket&gt;</a>.</p>\n<p>A client server pair demonstrating how to listen for the <code>'upgrade'</code> event.</p>\n<pre><code class=\"language-js\">const http = require('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, socket, head) => {\n  socket.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  socket.pipe(socket); // 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, socket, upgradeHead) => {\n    console.log('got upgraded!');\n    socket.end();\n    process.exit(0);\n  });\n});\n</code></pre>"
            }
          ],
          "methods": [
            {
              "textRaw": "`request.abort()`",
              "type": "method",
              "name": "abort",
              "meta": {
                "added": [
                  "v0.3.8"
                ],
                "changes": []
              },
              "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.end([data[, encoding]][, callback])`",
              "type": "method",
              "name": "end",
              "meta": {
                "added": [
                  "v0.1.90"
                ],
                "changes": [
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/18780",
                    "description": "This method now returns a reference to `ClientRequest`."
                  }
                ]
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {this}",
                    "name": "return",
                    "type": "this"
                  },
                  "params": [
                    {
                      "textRaw": "`data` {string|Buffer}",
                      "name": "data",
                      "type": "string|Buffer"
                    },
                    {
                      "textRaw": "`encoding` {string}",
                      "name": "encoding",
                      "type": "string"
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function"
                    }
                  ]
                }
              ],
              "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=\"http.html#http_request_write_chunk_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.flushHeaders()`",
              "type": "method",
              "name": "flushHeaders",
              "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)`",
              "type": "method",
              "name": "getHeader",
              "meta": {
                "added": [
                  "v1.6.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {any}",
                    "name": "return",
                    "type": "any"
                  },
                  "params": [
                    {
                      "textRaw": "`name` {string}",
                      "name": "name",
                      "type": "string"
                    }
                  ]
                }
              ],
              "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=\"http.html#http_request_setheader_name_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.removeHeader(name)`",
              "type": "method",
              "name": "removeHeader",
              "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)`",
              "type": "method",
              "name": "setHeader",
              "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=\"http.html#http_request_getheader_name\"><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>"
            },
            {
              "textRaw": "`request.setNoDelay([noDelay])`",
              "type": "method",
              "name": "setNoDelay",
              "meta": {
                "added": [
                  "v0.5.9"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`noDelay` {boolean}",
                      "name": "noDelay",
                      "type": "boolean"
                    }
                  ]
                }
              ],
              "desc": "<p>Once a socket is assigned to this request and is connected\n<a href=\"net.html#net_socket_setnodelay_nodelay\"><code>socket.setNoDelay()</code></a> will be called.</p>"
            },
            {
              "textRaw": "`request.setSocketKeepAlive([enable][, initialDelay])`",
              "type": "method",
              "name": "setSocketKeepAlive",
              "meta": {
                "added": [
                  "v0.5.9"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`enable` {boolean}",
                      "name": "enable",
                      "type": "boolean"
                    },
                    {
                      "textRaw": "`initialDelay` {number}",
                      "name": "initialDelay",
                      "type": "number"
                    }
                  ]
                }
              ],
              "desc": "<p>Once a socket is assigned to this request and is connected\n<a href=\"net.html#net_socket_setkeepalive_enable_initialdelay\"><code>socket.setKeepAlive()</code></a> will be called.</p>"
            },
            {
              "textRaw": "`request.setTimeout(timeout[, callback])`",
              "type": "method",
              "name": "setTimeout",
              "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": [
                {
                  "return": {
                    "textRaw": "Returns: {http.ClientRequest}",
                    "name": "return",
                    "type": "http.ClientRequest"
                  },
                  "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."
                    }
                  ]
                }
              ],
              "desc": "<p>Once a socket is assigned to this request and is connected\n<a href=\"net.html#net_socket_settimeout_timeout_callback\"><code>socket.setTimeout()</code></a> will be called.</p>"
            },
            {
              "textRaw": "`request.write(chunk[, encoding][, callback])`",
              "type": "method",
              "name": "write",
              "meta": {
                "added": [
                  "v0.1.29"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  },
                  "params": [
                    {
                      "textRaw": "`chunk` {string|Buffer}",
                      "name": "chunk",
                      "type": "string|Buffer"
                    },
                    {
                      "textRaw": "`encoding` {string}",
                      "name": "encoding",
                      "type": "string"
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function"
                    }
                  ]
                }
              ],
              "desc": "<p>Sends a chunk of the body. By calling this method\nmany times, a request body can be sent to a\nserver. In that case, it is suggested to use the\n<code>['Transfer-Encoding', 'chunked']</code> header line when\ncreating 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": "`aborted` {boolean}",
              "type": "boolean",
              "name": "aborted",
              "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."
                  }
                ]
              },
              "desc": "<p>The <code>request.aborted</code> property will be <code>true</code> if the request has\nbeen aborted.</p>"
            },
            {
              "textRaw": "`connection` {stream.Duplex}",
              "type": "stream.Duplex",
              "name": "connection",
              "meta": {
                "added": [
                  "v0.3.0"
                ],
                "changes": []
              },
              "desc": "<p>See <a href=\"http.html#http_request_socket\"><code>request.socket</code></a>.</p>"
            },
            {
              "textRaw": "`finished` {boolean}",
              "type": "boolean",
              "name": "finished",
              "meta": {
                "added": [
                  "v0.0.1"
                ],
                "deprecated": [
                  "v12.16.0"
                ],
                "changes": []
              },
              "stability": 0,
              "stabilityText": "Deprecated. Use [`request.writableEnded`][].",
              "desc": "<p>The <code>request.finished</code> property will be <code>true</code> if <a href=\"http.html#http_request_end_data_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=\"http.html#http_http_get_options_callback\"><code>http.get()</code></a>.</p>"
            },
            {
              "textRaw": "`maxHeadersCount` {number} **Default:** `2000`",
              "type": "number",
              "name": "maxHeadersCount",
              "default": "`2000`",
              "desc": "<p>Limits maximum response headers count. If set to 0, no limit will be applied.</p>"
            },
            {
              "textRaw": "`path` {string} The request path.",
              "type": "string",
              "name": "path",
              "meta": {
                "added": [
                  "v0.4.0"
                ],
                "changes": []
              },
              "desc": "The request path."
            },
            {
              "textRaw": "`reusedSocket` {boolean} Whether the request is send through a reused socket.",
              "type": "boolean",
              "name": "reusedSocket",
              "meta": {
                "added": [
                  "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-js\">const http = require('http');\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-js\">const http = require('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": "`socket` {stream.Duplex}",
              "type": "stream.Duplex",
              "name": "socket",
              "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. The <code>socket</code>\nmay also be accessed via <code>request.connection</code>.</p>\n<pre><code class=\"language-js\">const http = require('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#net_class_net_socket\" class=\"type\">&lt;net.Socket&gt;</a> class,\na subclass of <a href=\"stream.html#stream_class_stream_duplex\" class=\"type\">&lt;stream.Duplex&gt;</a>, unless the user specified a socket\ntype other than <a href=\"net.html#net_class_net_socket\" class=\"type\">&lt;net.Socket&gt;</a>.</p>"
            },
            {
              "textRaw": "`writableEnded` {boolean}",
              "type": "boolean",
              "name": "writableEnded",
              "meta": {
                "added": [
                  "v12.9.0"
                ],
                "changes": []
              },
              "desc": "<p>Is <code>true</code> after <a href=\"http.html#http_request_end_data_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=\"http.html#http_request_writablefinished\"><code>request.writableFinished</code></a> instead.</p>"
            },
            {
              "textRaw": "`writableFinished` {boolean}",
              "type": "boolean",
              "name": "writableFinished",
              "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=\"http.html#http_event_finish\"><code>'finish'</code></a> event is emitted.</p>"
            }
          ]
        },
        {
          "textRaw": "Class: `http.Server`",
          "type": "class",
          "name": "http.Server",
          "meta": {
            "added": [
              "v0.1.17"
            ],
            "changes": []
          },
          "desc": "<ul>\n<li>Extends: <a href=\"net.html#net_class_net_server\" class=\"type\">&lt;net.Server&gt;</a></li>\n</ul>",
          "events": [
            {
              "textRaw": "Event: `'checkContinue'`",
              "type": "event",
              "name": "checkContinue",
              "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=\"http.html#http_response_writecontinue\"><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=\"http.html#http_event_request\"><code>'request'</code></a> event will\nnot be emitted.</p>"
            },
            {
              "textRaw": "Event: `'checkExpectation'`",
              "type": "event",
              "name": "checkExpectation",
              "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=\"http.html#http_event_request\"><code>'request'</code></a> event will\nnot be emitted.</p>"
            },
            {
              "textRaw": "Event: `'clientError'`",
              "type": "event",
              "name": "clientError",
              "meta": {
                "added": [
                  "v0.1.94"
                ],
                "changes": [
                  {
                    "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'`."
                  },
                  {
                    "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": "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 a HPE_HEADER_OVERFLOW error occurs."
                  }
                ]
              },
              "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.</p>\n<p>This event is guaranteed to be passed an instance of the <a href=\"net.html#net_class_net_socket\" class=\"type\">&lt;net.Socket&gt;</a> class,\na subclass of <a href=\"stream.html#stream_class_stream_duplex\" class=\"type\">&lt;stream.Duplex&gt;</a>, unless the user specifies a socket\ntype other than <a href=\"net.html#net_class_net_socket\" class=\"type\">&lt;net.Socket&gt;</a>.</p>\n<p>Default behavior is to try close the socket with a HTTP '400 Bad Request',\nor a HTTP '431 Request Header Fields Too Large' in the case of a\n<a href=\"errors.html#errors_hpe_header_overflow\"><code>HPE_HEADER_OVERFLOW</code></a> error. If the socket is not writable it is\nimmediately destroyed.</p>\n<p><code>socket</code> is the <a href=\"net.html#net_class_net_socket\"><code>net.Socket</code></a> object that the error originated from.</p>\n<pre><code class=\"language-js\">const http = require('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'`",
              "type": "event",
              "name": "close",
              "meta": {
                "added": [
                  "v0.1.4"
                ],
                "changes": []
              },
              "params": [],
              "desc": "<p>Emitted when the server closes.</p>"
            },
            {
              "textRaw": "Event: `'connect'`",
              "type": "event",
              "name": "connect",
              "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#net_class_net_socket\" class=\"type\">&lt;net.Socket&gt;</a> class,\na subclass of <a href=\"stream.html#stream_class_stream_duplex\" class=\"type\">&lt;stream.Duplex&gt;</a>, unless the user specifies a socket\ntype other than <a href=\"net.html#net_class_net_socket\" class=\"type\">&lt;net.Socket&gt;</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'`",
              "type": "event",
              "name": "connection",
              "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#net_class_net_socket\"><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.connection</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#stream_class_stream_duplex\"><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#net_class_net_socket\" class=\"type\">&lt;net.Socket&gt;</a> class,\na subclass of <a href=\"stream.html#stream_class_stream_duplex\" class=\"type\">&lt;stream.Duplex&gt;</a>, unless the user specifies a socket\ntype other than <a href=\"net.html#net_class_net_socket\" class=\"type\">&lt;net.Socket&gt;</a>.</p>"
            },
            {
              "textRaw": "Event: `'request'`",
              "type": "event",
              "name": "request",
              "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'`",
              "type": "event",
              "name": "upgrade",
              "meta": {
                "added": [
                  "v0.1.94"
                ],
                "changes": [
                  {
                    "version": "v10.0.0",
                    "pr-url": "v10.0.0",
                    "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": "`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 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 requests an HTTP upgrade. Listening to this event\nis optional and clients cannot insist on a protocol change.</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>\n<p>This event is guaranteed to be passed an instance of the <a href=\"net.html#net_class_net_socket\" class=\"type\">&lt;net.Socket&gt;</a> class,\na subclass of <a href=\"stream.html#stream_class_stream_duplex\" class=\"type\">&lt;stream.Duplex&gt;</a>, unless the user specifies a socket\ntype other than <a href=\"net.html#net_class_net_socket\" class=\"type\">&lt;net.Socket&gt;</a>.</p>"
            }
          ],
          "methods": [
            {
              "textRaw": "`server.close([callback])`",
              "type": "method",
              "name": "close",
              "meta": {
                "added": [
                  "v0.1.90"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function"
                    }
                  ]
                }
              ],
              "desc": "<p>Stops the server from accepting new connections. See <a href=\"net.html#net_server_close_callback\"><code>net.Server.close()</code></a>.</p>"
            },
            {
              "textRaw": "`server.listen()`",
              "type": "method",
              "name": "listen",
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Starts the HTTP server listening for connections.\nThis method is identical to <a href=\"net.html#net_server_listen\"><code>server.listen()</code></a> from <a href=\"net.html#net_class_net_server\"><code>net.Server</code></a>.</p>"
            },
            {
              "textRaw": "`server.setTimeout([msecs][, callback])`",
              "type": "method",
              "name": "setTimeout",
              "meta": {
                "added": [
                  "v0.9.12"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {http.Server}",
                    "name": "return",
                    "type": "http.Server"
                  },
                  "params": [
                    {
                      "textRaw": "`msecs` {number} **Default:** `120000` (2 minutes)",
                      "name": "msecs",
                      "type": "number",
                      "default": "`120000` (2 minutes)"
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function"
                    }
                  ]
                }
              ],
              "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's timeout value is 2 minutes, and sockets are\ndestroyed automatically if they time out. However, if a callback is assigned\nto the Server's <code>'timeout'</code> event, timeouts must be handled explicitly.</p>\n<p>To change the default timeout use the <a href=\"cli.html#cli_http_server_default_timeout_milliseconds\"><code>--http-server-default-timeout</code></a>\nflag.</p>"
            }
          ],
          "properties": [
            {
              "textRaw": "`headersTimeout` {number} **Default:** `60000`",
              "type": "number",
              "name": "headersTimeout",
              "meta": {
                "added": [
                  "v11.3.0"
                ],
                "changes": []
              },
              "default": "`60000`",
              "desc": "<p>Limit the amount of time the parser will wait to receive the complete HTTP\nheaders.</p>\n<p>In case of inactivity, the rules defined in <a href=\"http.html#http_server_timeout\"><code>server.timeout</code></a> apply. However,\nthat inactivity based timeout would still allow the connection to be kept open\nif the headers are being sent very slowly (by default, up to a byte per 2\nminutes). In order to prevent this, whenever header data arrives an additional\ncheck is made that more than <code>server.headersTimeout</code> milliseconds has not\npassed since the connection was established. If the check fails, a <code>'timeout'</code>\nevent is emitted on the server object, and (by default) the socket is destroyed.\nSee <a href=\"http.html#http_server_timeout\"><code>server.timeout</code></a> for more information on how timeout behavior can be\ncustomized.</p>\n<p>A value of <code>0</code> will disable the HTTP headers timeout check.</p>"
            },
            {
              "textRaw": "`listening` {boolean} Indicates whether or not the server is listening for connections.",
              "type": "boolean",
              "name": "listening",
              "meta": {
                "added": [
                  "v5.7.0"
                ],
                "changes": []
              },
              "desc": "Indicates whether or not the server is listening for connections."
            },
            {
              "textRaw": "`maxHeadersCount` {number} **Default:** `2000`",
              "type": "number",
              "name": "maxHeadersCount",
              "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": "`timeout` {number} Timeout in milliseconds. **Default:** `120000` (2 minutes).",
              "type": "number",
              "name": "timeout",
              "meta": {
                "added": [
                  "v0.9.12"
                ],
                "changes": []
              },
              "default": "`120000` (2 minutes)",
              "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>\n<p>To change the default timeout use the <a href=\"cli.html#cli_http_server_default_timeout_milliseconds\"><code>--http-server-default-timeout</code></a>\nflag.</p>",
              "shortDesc": "Timeout in milliseconds."
            },
            {
              "textRaw": "`keepAliveTimeout` {number} Timeout in milliseconds. **Default:** `5000` (5 seconds).",
              "type": "number",
              "name": "keepAliveTimeout",
              "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. If the server receives new data before the keep-alive\ntimeout has fired, it will reset the regular inactivity timeout, i.e.,\n<a href=\"http.html#http_server_timeout\"><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": "Class: `http.ServerResponse`",
          "type": "class",
          "name": "http.ServerResponse",
          "meta": {
            "added": [
              "v0.1.17"
            ],
            "changes": []
          },
          "desc": "<ul>\n<li>Extends: <a href=\"stream.html#stream_stream\" class=\"type\">&lt;Stream&gt;</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=\"http.html#http_event_request\"><code>'request'</code></a> event.</p>",
          "events": [
            {
              "textRaw": "Event: `'close'`",
              "type": "event",
              "name": "close",
              "meta": {
                "added": [
                  "v0.6.7"
                ],
                "changes": []
              },
              "params": [],
              "desc": "<p>Indicates that the underlying connection was terminated.</p>"
            },
            {
              "textRaw": "Event: `'finish'`",
              "type": "event",
              "name": "finish",
              "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)`",
              "type": "method",
              "name": "addTrailers",
              "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#errors_class_typeerror\"><code>TypeError</code></a> being thrown.</p>"
            },
            {
              "textRaw": "`response.cork()`",
              "type": "method",
              "name": "cork",
              "meta": {
                "added": [
                  "v12.16.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>See <a href=\"stream.html#stream_writable_cork\"><code>writable.cork()</code></a>.</p>"
            },
            {
              "textRaw": "`response.end([data[, encoding]][, callback])`",
              "type": "method",
              "name": "end",
              "meta": {
                "added": [
                  "v0.1.90"
                ],
                "changes": [
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/18780",
                    "description": "This method now returns a reference to `ServerResponse`."
                  }
                ]
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {this}",
                    "name": "return",
                    "type": "this"
                  },
                  "params": [
                    {
                      "textRaw": "`data` {string|Buffer}",
                      "name": "data",
                      "type": "string|Buffer"
                    },
                    {
                      "textRaw": "`encoding` {string}",
                      "name": "encoding",
                      "type": "string"
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function"
                    }
                  ]
                }
              ],
              "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=\"http.html#http_response_write_chunk_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()`",
              "type": "method",
              "name": "flushHeaders",
              "meta": {
                "added": [
                  "v1.6.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Flushes the response headers. See also: <a href=\"http.html#http_request_flushheaders\"><code>request.flushHeaders()</code></a>.</p>"
            },
            {
              "textRaw": "`response.getHeader(name)`",
              "type": "method",
              "name": "getHeader",
              "meta": {
                "added": [
                  "v0.4.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {any}",
                    "name": "return",
                    "type": "any"
                  },
                  "params": [
                    {
                      "textRaw": "`name` {string}",
                      "name": "name",
                      "type": "string"
                    }
                  ]
                }
              ],
              "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=\"http.html#http_response_setheader_name_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()`",
              "type": "method",
              "name": "getHeaderNames",
              "meta": {
                "added": [
                  "v7.7.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {string[]}",
                    "name": "return",
                    "type": "string[]"
                  },
                  "params": []
                }
              ],
              "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()`",
              "type": "method",
              "name": "getHeaders",
              "meta": {
                "added": [
                  "v7.7.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Object}",
                    "name": "return",
                    "type": "Object"
                  },
                  "params": []
                }
              ],
              "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)`",
              "type": "method",
              "name": "hasHeader",
              "meta": {
                "added": [
                  "v7.7.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  },
                  "params": [
                    {
                      "textRaw": "`name` {string}",
                      "name": "name",
                      "type": "string"
                    }
                  ]
                }
              ],
              "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)`",
              "type": "method",
              "name": "removeHeader",
              "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)`",
              "type": "method",
              "name": "setHeader",
              "meta": {
                "added": [
                  "v0.4.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 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=\"http.html#http_response_getheader_name\"><code>response.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\">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#errors_class_typeerror\"><code>TypeError</code></a> being thrown.</p>\n<p>When headers have been set with <a href=\"http.html#http_response_setheader_name_value\"><code>response.setHeader()</code></a>, they will be merged\nwith any headers passed to <a href=\"http.html#http_response_writehead_statuscode_statusmessage_headers\"><code>response.writeHead()</code></a>, with the headers passed\nto <a href=\"http.html#http_response_writehead_statuscode_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=\"http.html#http_response_writehead_statuscode_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=\"http.html#http_response_getheader_name\"><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=\"http.html#http_response_setheader_name_value\"><code>response.setHeader()</code></a> instead of <a href=\"http.html#http_response_writehead_statuscode_statusmessage_headers\"><code>response.writeHead()</code></a>.</p>"
            },
            {
              "textRaw": "`response.setTimeout(msecs[, callback])`",
              "type": "method",
              "name": "setTimeout",
              "meta": {
                "added": [
                  "v0.9.12"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {http.ServerResponse}",
                    "name": "return",
                    "type": "http.ServerResponse"
                  },
                  "params": [
                    {
                      "textRaw": "`msecs` {number}",
                      "name": "msecs",
                      "type": "number"
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function"
                    }
                  ]
                }
              ],
              "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()`",
              "type": "method",
              "name": "uncork",
              "meta": {
                "added": [
                  "v12.16.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>See <a href=\"stream.html#stream_writable_uncork\"><code>writable.uncork()</code></a>.</p>"
            },
            {
              "textRaw": "`response.write(chunk[, encoding][, callback])`",
              "type": "method",
              "name": "write",
              "meta": {
                "added": [
                  "v0.1.29"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  },
                  "params": [
                    {
                      "textRaw": "`chunk` {string|Buffer}",
                      "name": "chunk",
                      "type": "string|Buffer"
                    },
                    {
                      "textRaw": "`encoding` {string} **Default:** `'utf8'`",
                      "name": "encoding",
                      "type": "string",
                      "default": "`'utf8'`"
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function"
                    }
                  ]
                }
              ],
              "desc": "<p>If this method is called and <a href=\"http.html#http_response_writehead_statuscode_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>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.\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=\"http.html#http_response_write_chunk_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=\"http.html#http_response_write_chunk_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()`",
              "type": "method",
              "name": "writeContinue",
              "meta": {
                "added": [
                  "v0.3.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Sends a HTTP/1.1 100 Continue message to the client, indicating that\nthe request body should be sent. See the <a href=\"http.html#http_event_checkcontinue\"><code>'checkContinue'</code></a> event on\n<code>Server</code>.</p>"
            },
            {
              "textRaw": "`response.writeHead(statusCode[, statusMessage][, headers])`",
              "type": "method",
              "name": "writeHead",
              "meta": {
                "added": [
                  "v0.1.30"
                ],
                "changes": [
                  {
                    "version": "v11.10.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": [
                {
                  "return": {
                    "textRaw": "Returns: {http.ServerResponse}",
                    "name": "return",
                    "type": "http.ServerResponse"
                  },
                  "params": [
                    {
                      "textRaw": "`statusCode` {number}",
                      "name": "statusCode",
                      "type": "number"
                    },
                    {
                      "textRaw": "`statusMessage` {string}",
                      "name": "statusMessage",
                      "type": "string"
                    },
                    {
                      "textRaw": "`headers` {Object}",
                      "name": "headers",
                      "type": "Object"
                    }
                  ]
                }
              ],
              "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>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=\"http.html#http_response_end_data_encoding_callback\"><code>response.end()</code></a> is called.</p>\n<p>If <a href=\"http.html#http_response_write_chunk_encoding_callback\"><code>response.write()</code></a> or <a href=\"http.html#http_response_end_data_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=\"http.html#http_response_setheader_name_value\"><code>response.setHeader()</code></a>, they will be merged\nwith any headers passed to <a href=\"http.html#http_response_writehead_statuscode_statusmessage_headers\"><code>response.writeHead()</code></a>, with the headers passed\nto <a href=\"http.html#http_response_writehead_statuscode_statusmessage_headers\"><code>response.writeHead()</code></a> given precedence.</p>\n<p>If this method is called and <a href=\"http.html#http_response_setheader_name_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=\"http.html#http_response_getheader_name\"><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=\"http.html#http_response_setheader_name_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 given in bytes, not characters. Use\n<a href=\"buffer.html#buffer_class_method_buffer_bytelength_string_encoding\"><code>Buffer.byteLength()</code></a> to determine the length of the body in bytes. Node.js\ndoes not 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#errors_class_typeerror\"><code>TypeError</code></a> being thrown.</p>"
            },
            {
              "textRaw": "`response.writeProcessing()`",
              "type": "method",
              "name": "writeProcessing",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Sends a HTTP/1.1 102 Processing message to the client, indicating that\nthe request body should be sent.</p>"
            }
          ],
          "properties": [
            {
              "textRaw": "`connection` {stream.Duplex}",
              "type": "stream.Duplex",
              "name": "connection",
              "meta": {
                "added": [
                  "v0.3.0"
                ],
                "changes": []
              },
              "desc": "<p>See <a href=\"http.html#http_response_socket\"><code>response.socket</code></a>.</p>"
            },
            {
              "textRaw": "`finished` {boolean}",
              "type": "boolean",
              "name": "finished",
              "meta": {
                "added": [
                  "v0.0.2"
                ],
                "deprecated": [
                  "v12.16.0"
                ],
                "changes": []
              },
              "stability": 0,
              "stabilityText": "Deprecated. Use [`response.writableEnded`][].",
              "desc": "<p>The <code>response.finished</code> property will be <code>true</code> if <a href=\"http.html#http_response_end_data_encoding_callback\"><code>response.end()</code></a>\nhas been called.</p>"
            },
            {
              "textRaw": "`headersSent` {boolean}",
              "type": "boolean",
              "name": "headersSent",
              "meta": {
                "added": [
                  "v0.9.3"
                ],
                "changes": []
              },
              "desc": "<p>Boolean (read-only). True if headers were sent, false otherwise.</p>"
            },
            {
              "textRaw": "`sendDate` {boolean}",
              "type": "boolean",
              "name": "sendDate",
              "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; HTTP requires the Date header\nin responses.</p>"
            },
            {
              "textRaw": "`socket` {stream.Duplex}",
              "type": "stream.Duplex",
              "name": "socket",
              "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. The <code>socket</code> may also be accessed\nvia <code>response.connection</code>.</p>\n<pre><code class=\"language-js\">const http = require('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#net_class_net_socket\" class=\"type\">&lt;net.Socket&gt;</a> class,\na subclass of <a href=\"stream.html#stream_class_stream_duplex\" class=\"type\">&lt;stream.Duplex&gt;</a>, unless the user specified a socket\ntype other than <a href=\"net.html#net_class_net_socket\" class=\"type\">&lt;net.Socket&gt;</a>.</p>"
            },
            {
              "textRaw": "`statusCode` {number} **Default:** `200`",
              "type": "number",
              "name": "statusCode",
              "meta": {
                "added": [
                  "v0.4.0"
                ],
                "changes": []
              },
              "default": "`200`",
              "desc": "<p>When using implicit headers (not calling <a href=\"http.html#http_response_writehead_statuscode_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": "`statusMessage` {string}",
              "type": "string",
              "name": "statusMessage",
              "meta": {
                "added": [
                  "v0.11.8"
                ],
                "changes": []
              },
              "desc": "<p>When using implicit headers (not calling <a href=\"http.html#http_response_writehead_statuscode_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": "`writableEnded` {boolean}",
              "type": "boolean",
              "name": "writableEnded",
              "meta": {
                "added": [
                  "v12.9.0"
                ],
                "changes": []
              },
              "desc": "<p>Is <code>true</code> after <a href=\"http.html#http_response_end_data_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=\"http.html#http_response_writablefinished\"><code>response.writableFinished</code></a> instead.</p>"
            },
            {
              "textRaw": "`writableFinished` {boolean}",
              "type": "boolean",
              "name": "writableFinished",
              "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=\"http.html#http_event_finish\"><code>'finish'</code></a> event is emitted.</p>"
            }
          ]
        },
        {
          "textRaw": "Class: `http.IncomingMessage`",
          "type": "class",
          "name": "http.IncomingMessage",
          "meta": {
            "added": [
              "v0.1.17"
            ],
            "changes": [
              {
                "version": "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#stream_class_stream_readable\" class=\"type\">&lt;stream.Readable&gt;</a></li>\n</ul>\n<p>An <code>IncomingMessage</code> object is created by <a href=\"http.html#http_class_http_server\"><code>http.Server</code></a> or\n<a href=\"http.html#http_class_http_clientrequest\"><code>http.ClientRequest</code></a> and passed as the first argument to the <a href=\"http.html#http_event_request\"><code>'request'</code></a>\nand <a href=\"http.html#http_event_response\"><code>'response'</code></a> event respectively. It may be used to access response\nstatus, headers and data.</p>",
          "events": [
            {
              "textRaw": "Event: `'aborted'`",
              "type": "event",
              "name": "aborted",
              "meta": {
                "added": [
                  "v0.3.8"
                ],
                "changes": []
              },
              "params": [],
              "desc": "<p>Emitted when the request has been aborted.</p>"
            },
            {
              "textRaw": "Event: `'close'`",
              "type": "event",
              "name": "close",
              "meta": {
                "added": [
                  "v0.4.2"
                ],
                "changes": []
              },
              "params": [],
              "desc": "<p>Indicates that the underlying connection was closed.</p>"
            }
          ],
          "properties": [
            {
              "textRaw": "`aborted` {boolean}",
              "type": "boolean",
              "name": "aborted",
              "meta": {
                "added": [
                  "v10.1.0"
                ],
                "changes": []
              },
              "desc": "<p>The <code>message.aborted</code> property will be <code>true</code> if the request has\nbeen aborted.</p>"
            },
            {
              "textRaw": "`complete` {boolean}",
              "type": "boolean",
              "name": "complete",
              "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": "`headers` {Object}",
              "type": "Object",
              "name": "headers",
              "meta": {
                "added": [
                  "v0.1.5"
                ],
                "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>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.</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>"
            },
            {
              "textRaw": "`httpVersion` {string}",
              "type": "string",
              "name": "httpVersion",
              "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": "`method` {string}",
              "type": "string",
              "name": "method",
              "meta": {
                "added": [
                  "v0.1.1"
                ],
                "changes": []
              },
              "desc": "<p><strong>Only valid for request obtained from <a href=\"http.html#http_class_http_server\"><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": "`rawHeaders` {string[]}",
              "type": "string[]",
              "name": "rawHeaders",
              "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": "`rawTrailers` {string[]}",
              "type": "string[]",
              "name": "rawTrailers",
              "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": "`socket` {stream.Duplex}",
              "type": "stream.Duplex",
              "name": "socket",
              "meta": {
                "added": [
                  "v0.3.0"
                ],
                "changes": []
              },
              "desc": "<p>The <a href=\"net.html#net_class_net_socket\"><code>net.Socket</code></a> object associated with the connection.</p>\n<p>With HTTPS support, use <a href=\"tls.html#tls_tlssocket_getpeercertificate_detailed\"><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#net_class_net_socket\" class=\"type\">&lt;net.Socket&gt;</a> class,\na subclass of <a href=\"stream.html#stream_class_stream_duplex\" class=\"type\">&lt;stream.Duplex&gt;</a>, unless the user specified a socket\ntype other than <a href=\"net.html#net_class_net_socket\" class=\"type\">&lt;net.Socket&gt;</a>.</p>"
            },
            {
              "textRaw": "`statusCode` {number}",
              "type": "number",
              "name": "statusCode",
              "meta": {
                "added": [
                  "v0.1.1"
                ],
                "changes": []
              },
              "desc": "<p><strong>Only valid for response obtained from <a href=\"http.html#http_class_http_clientrequest\"><code>http.ClientRequest</code></a>.</strong></p>\n<p>The 3-digit HTTP response status code. E.G. <code>404</code>.</p>"
            },
            {
              "textRaw": "`statusMessage` {string}",
              "type": "string",
              "name": "statusMessage",
              "meta": {
                "added": [
                  "v0.11.10"
                ],
                "changes": []
              },
              "desc": "<p><strong>Only valid for response obtained from <a href=\"http.html#http_class_http_clientrequest\"><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": "`trailers` {Object}",
              "type": "Object",
              "name": "trailers",
              "meta": {
                "added": [
                  "v0.3.0"
                ],
                "changes": []
              },
              "desc": "<p>The request/response trailers object. Only populated at the <code>'end'</code> event.</p>"
            },
            {
              "textRaw": "`url` {string}",
              "type": "string",
              "name": "url",
              "meta": {
                "added": [
                  "v0.1.90"
                ],
                "changes": []
              },
              "desc": "<p><strong>Only valid for request obtained from <a href=\"http.html#http_class_http_server\"><code>http.Server</code></a>.</strong></p>\n<p>Request URL string. This contains only the URL that is\npresent in the actual HTTP request. If the request is:</p>\n<pre><code class=\"language-http\">GET /status?name=ryan HTTP/1.1\\r\\n\nAccept: text/plain\\r\\n\n\\r\\n\n</code></pre>\n<p>To parse the URL into its parts:</p>\n<pre><code class=\"language-js\">new URL(request.url, `http://${request.headers.host}`);\n</code></pre>\n<p>When <code>request.url</code> is <code>'/status?name=ryan'</code> and\n<code>request.headers.host</code> is <code>'localhost:3000'</code>:</p>\n<pre><code class=\"language-console\">$ node\n> new URL(request.url, `http://${request.headers.host}`)\nURL {\n  href: 'http://localhost:3000/status?name=ryan',\n  origin: 'http://localhost:3000',\n  protocol: 'http:',\n  username: '',\n  password: '',\n  host: 'localhost:3000',\n  hostname: 'localhost',\n  port: '3000',\n  pathname: '/status',\n  search: '?name=ryan',\n  searchParams: URLSearchParams { 'name' => 'ryan' },\n  hash: ''\n}\n</code></pre>"
            }
          ],
          "methods": [
            {
              "textRaw": "`message.destroy([error])`",
              "type": "method",
              "name": "destroy",
              "meta": {
                "added": [
                  "v0.3.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`error` {Error}",
                      "name": "error",
                      "type": "Error"
                    }
                  ]
                }
              ],
              "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])`",
              "type": "method",
              "name": "setTimeout",
              "meta": {
                "added": [
                  "v0.5.9"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {http.IncomingMessage}",
                    "name": "return",
                    "type": "http.IncomingMessage"
                  },
                  "params": [
                    {
                      "textRaw": "`msecs` {number}",
                      "name": "msecs",
                      "type": "number"
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function"
                    }
                  ]
                }
              ],
              "desc": "<p>Calls <code>message.connection.setTimeout(msecs, callback)</code>.</p>"
            }
          ]
        }
      ],
      "properties": [
        {
          "textRaw": "`METHODS` {string[]}",
          "type": "string[]",
          "name": "METHODS",
          "meta": {
            "added": [
              "v0.11.8"
            ],
            "changes": []
          },
          "desc": "<p>A list of the HTTP methods that are supported by the parser.</p>"
        },
        {
          "textRaw": "`STATUS_CODES` {Object}",
          "type": "Object",
          "name": "STATUS_CODES",
          "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": "`globalAgent` {http.Agent}",
          "type": "http.Agent",
          "name": "globalAgent",
          "meta": {
            "added": [
              "v0.5.9"
            ],
            "changes": []
          },
          "desc": "<p>Global instance of <code>Agent</code> which is used as the default for all HTTP client\nrequests.</p>"
        },
        {
          "textRaw": "`maxHeaderSize` {number}",
          "type": "number",
          "name": "maxHeaderSize",
          "meta": {
            "added": [
              "v11.6.0"
            ],
            "changes": []
          },
          "desc": "<p>Read-only property specifying the maximum allowed size of HTTP headers in bytes.\nDefaults to 8KB. Configurable using the <a href=\"cli.html#cli_max_http_header_size_size\"><code>--max-http-header-size</code></a> CLI option.</p>"
        }
      ],
      "methods": [
        {
          "textRaw": "`http.createServer([options][, requestListener])`",
          "type": "method",
          "name": "createServer",
          "meta": {
            "added": [
              "v0.1.13"
            ],
            "changes": [
              {
                "version": "v12.15.0",
                "pr-url": "https://github.com/nodejs/node/pull/31448",
                "description": "The `insecureHTTPParser` 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": [
            {
              "return": {
                "textRaw": "Returns: {http.Server}",
                "name": "return",
                "type": "http.Server"
              },
              "params": [
                {
                  "textRaw": "`options` {Object}",
                  "name": "options",
                  "type": "Object",
                  "options": [
                    {
                      "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": "`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": "`insecureHTTPParser` {boolean} Use an insecure HTTP parser that accepts invalid HTTP headers when `true`. Using the insecure parser should be avoided. See [`--insecure-http-parser`][] for more information. **Default:** `false`",
                      "name": "insecureHTTPParser",
                      "type": "boolean",
                      "default": "`false`",
                      "desc": "Use an insecure HTTP parser that accepts invalid HTTP headers when `true`. Using the insecure parser should be avoided. See [`--insecure-http-parser`][] for more information."
                    }
                  ]
                },
                {
                  "textRaw": "`requestListener` {Function}",
                  "name": "requestListener",
                  "type": "Function"
                }
              ]
            }
          ],
          "desc": "<p>Returns a new instance of <a href=\"http.html#http_class_http_server\"><code>http.Server</code></a>.</p>\n<p>The <code>requestListener</code> is a function which is automatically\nadded to the <a href=\"http.html#http_event_request\"><code>'request'</code></a> event.</p>"
        },
        {
          "textRaw": "`http.get(options[, callback])`",
          "type": "method",
          "name": "get",
          "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": [
            {
              "return": {
                "textRaw": "Returns: {http.ClientRequest}",
                "name": "return",
                "type": "http.ClientRequest"
              },
              "params": [
                {
                  "textRaw": "`url` {string | URL}",
                  "name": "url",
                  "type": "string | URL"
                },
                {
                  "textRaw": "`options` {Object} Accepts the same `options` as [`http.request()`][], with the `method` always set to `GET`. Properties that are inherited from the prototype are ignored.",
                  "name": "options",
                  "type": "Object",
                  "desc": "Accepts the same `options` as [`http.request()`][], with the `method` always set to `GET`. Properties that are inherited from the prototype are ignored."
                },
                {
                  "textRaw": "`callback` {Function}",
                  "name": "callback",
                  "type": "Function"
                }
              ]
            }
          ],
          "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=\"http.html#http_http_request_options_callback\"><code>http.request()</code></a> is that it sets the method to GET and calls <code>req.end()</code>\nautomatically. The callback must take care to consume the response\ndata for reasons stated in <a href=\"http.html#http_class_http_clientrequest\"><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=\"http.html#http_class_http_incomingmessage\"><code>http.IncomingMessage</code></a>.</p>\n<p>JSON fetching example:</p>\n<pre><code class=\"language-js\">http.get('http://nodejs.org/dist/index.json', (res) => {\n  const { statusCode } = res;\n  const contentType = res.headers['content-type'];\n\n  let error;\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</code></pre>"
        },
        {
          "textRaw": "`http.get(url[, options][, callback])`",
          "type": "method",
          "name": "get",
          "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": [
            {
              "return": {
                "textRaw": "Returns: {http.ClientRequest}",
                "name": "return",
                "type": "http.ClientRequest"
              },
              "params": [
                {
                  "textRaw": "`url` {string | URL}",
                  "name": "url",
                  "type": "string | URL"
                },
                {
                  "textRaw": "`options` {Object} Accepts the same `options` as [`http.request()`][], with the `method` always set to `GET`. Properties that are inherited from the prototype are ignored.",
                  "name": "options",
                  "type": "Object",
                  "desc": "Accepts the same `options` as [`http.request()`][], with the `method` always set to `GET`. Properties that are inherited from the prototype are ignored."
                },
                {
                  "textRaw": "`callback` {Function}",
                  "name": "callback",
                  "type": "Function"
                }
              ]
            }
          ],
          "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=\"http.html#http_http_request_options_callback\"><code>http.request()</code></a> is that it sets the method to GET and calls <code>req.end()</code>\nautomatically. The callback must take care to consume the response\ndata for reasons stated in <a href=\"http.html#http_class_http_clientrequest\"><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=\"http.html#http_class_http_incomingmessage\"><code>http.IncomingMessage</code></a>.</p>\n<p>JSON fetching example:</p>\n<pre><code class=\"language-js\">http.get('http://nodejs.org/dist/index.json', (res) => {\n  const { statusCode } = res;\n  const contentType = res.headers['content-type'];\n\n  let error;\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</code></pre>"
        },
        {
          "textRaw": "`http.request(options[, callback])`",
          "type": "method",
          "name": "request",
          "meta": {
            "added": [
              "v0.3.6"
            ],
            "changes": [
              {
                "version": "v12.15.0",
                "pr-url": "https://github.com/nodejs/node/pull/31448",
                "description": "The `insecureHTTPParser` 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": [
            {
              "return": {
                "textRaw": "Returns: {http.ClientRequest}",
                "name": "return",
                "type": "http.ClientRequest"
              },
              "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 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."
                    },
                    {
                      "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} An object containing request headers.",
                      "name": "headers",
                      "type": "Object",
                      "desc": "An object containing request headers."
                    },
                    {
                      "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": "`insecureHTTPParser` {boolean} Use an insecure HTTP parser that accepts invalid HTTP headers when `true`. Using the insecure parser should be avoided. See [`--insecure-http-parser`][] for more information. **Default:** `false`",
                      "name": "insecureHTTPParser",
                      "type": "boolean",
                      "default": "`false`",
                      "desc": "Use an insecure HTTP parser that accepts invalid HTTP headers when `true`. Using the insecure parser should be avoided. See [`--insecure-http-parser`][] 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": "`lookup` {Function} Custom lookup function. **Default:** [`dns.lookup()`][].",
                      "name": "lookup",
                      "type": "Function",
                      "default": "[`dns.lookup()`][]",
                      "desc": "Custom lookup function."
                    },
                    {
                      "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": "`setHost` {boolean}: Specifies whether or not to automatically add the `Host` header. Defaults to `true`.",
                      "name": "setHost",
                      "type": "boolean",
                      "desc": ": Specifies whether or not to automatically add the `Host` header. Defaults to `true`."
                    },
                    {
                      "textRaw": "`socketPath` {string} Unix Domain Socket (cannot be used if one of `host` or `port` is specified, those specify a TCP Socket).",
                      "name": "socketPath",
                      "type": "string",
                      "desc": "Unix Domain Socket (cannot be used if one of `host` or `port` is specified, 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": "`callback` {Function}",
                  "name": "callback",
                  "type": "Function"
                }
              ]
            }
          ],
          "desc": "<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#url_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#url_constructor_new_url_input_base\"><code>new URL()</code></a>. If it is a <a href=\"url.html#url_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=\"http.html#http_event_response\"><code>'response'</code></a> event.</p>\n<p><code>http.request()</code> returns an instance of the <a href=\"http.html#http_class_http_clientrequest\"><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-js\">const postData = querystring.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/x-www-form-urlencoded',\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#url_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>\n<p><code>'response'</code></p>\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>If <code>req.abort()</code> is called before the connection succeeds, the following events\nwill 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 events\nwill be emitted in the following order:</p>\n<ul>\n<li><code>'socket'</code></li>\n<li>\n<p><code>'response'</code></p>\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>'close'</code></li>\n<li><code>'end'</code> on the <code>res</code> object</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>"
        },
        {
          "textRaw": "`http.request(url[, options][, callback])`",
          "type": "method",
          "name": "request",
          "meta": {
            "added": [
              "v0.3.6"
            ],
            "changes": [
              {
                "version": "v12.15.0",
                "pr-url": "https://github.com/nodejs/node/pull/31448",
                "description": "The `insecureHTTPParser` 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": [
            {
              "return": {
                "textRaw": "Returns: {http.ClientRequest}",
                "name": "return",
                "type": "http.ClientRequest"
              },
              "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 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."
                    },
                    {
                      "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} An object containing request headers.",
                      "name": "headers",
                      "type": "Object",
                      "desc": "An object containing request headers."
                    },
                    {
                      "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": "`insecureHTTPParser` {boolean} Use an insecure HTTP parser that accepts invalid HTTP headers when `true`. Using the insecure parser should be avoided. See [`--insecure-http-parser`][] for more information. **Default:** `false`",
                      "name": "insecureHTTPParser",
                      "type": "boolean",
                      "default": "`false`",
                      "desc": "Use an insecure HTTP parser that accepts invalid HTTP headers when `true`. Using the insecure parser should be avoided. See [`--insecure-http-parser`][] 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": "`lookup` {Function} Custom lookup function. **Default:** [`dns.lookup()`][].",
                      "name": "lookup",
                      "type": "Function",
                      "default": "[`dns.lookup()`][]",
                      "desc": "Custom lookup function."
                    },
                    {
                      "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": "`setHost` {boolean}: Specifies whether or not to automatically add the `Host` header. Defaults to `true`.",
                      "name": "setHost",
                      "type": "boolean",
                      "desc": ": Specifies whether or not to automatically add the `Host` header. Defaults to `true`."
                    },
                    {
                      "textRaw": "`socketPath` {string} Unix Domain Socket (cannot be used if one of `host` or `port` is specified, those specify a TCP Socket).",
                      "name": "socketPath",
                      "type": "string",
                      "desc": "Unix Domain Socket (cannot be used if one of `host` or `port` is specified, 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": "`callback` {Function}",
                  "name": "callback",
                  "type": "Function"
                }
              ]
            }
          ],
          "desc": "<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#url_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#url_constructor_new_url_input_base\"><code>new URL()</code></a>. If it is a <a href=\"url.html#url_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=\"http.html#http_event_response\"><code>'response'</code></a> event.</p>\n<p><code>http.request()</code> returns an instance of the <a href=\"http.html#http_class_http_clientrequest\"><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-js\">const postData = querystring.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/x-www-form-urlencoded',\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#url_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>\n<p><code>'response'</code></p>\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>If <code>req.abort()</code> is called before the connection succeeds, the following events\nwill 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 events\nwill be emitted in the following order:</p>\n<ul>\n<li><code>'socket'</code></li>\n<li>\n<p><code>'response'</code></p>\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>'close'</code></li>\n<li><code>'end'</code> on the <code>res</code> object</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>"
        }
      ],
      "type": "module",
      "displayName": "HTTP"
    },
    {
      "textRaw": "HTTP/2",
      "name": "http/2",
      "meta": {
        "added": [
          "v8.4.0"
        ],
        "changes": [
          {
            "version": "v10.10.0",
            "pr-url": "https://github.com/nodejs/node/pull/22466",
            "description": "HTTP/2 is now Stable. Previously, it had been Experimental."
          }
        ]
      },
      "introduced_in": "v8.4.0",
      "stability": 2,
      "stabilityText": "Stable",
      "desc": "<p>The <code>http2</code> module provides an implementation of the <a href=\"https://tools.ietf.org/html/rfc7540\">HTTP/2</a> protocol. It\ncan be accessed using:</p>\n<pre><code class=\"language-js\">const http2 = require('http2');\n</code></pre>",
      "modules": [
        {
          "textRaw": "Core API",
          "name": "core_api",
          "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=\"http2.html#http2_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",
              "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=\"http2.html#http2_http2_createsecureserver_options_onrequesthandler\"><code>http2.createSecureServer()</code></a> is necessary when communicating\nwith browser clients.</p>\n<pre><code class=\"language-js\">const http2 = require('http2');\nconst fs = require('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',\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>",
              "type": "module",
              "displayName": "Server-side example"
            },
            {
              "textRaw": "Client-side example",
              "name": "client-side_example",
              "desc": "<p>The following illustrates an HTTP/2 client:</p>\n<pre><code class=\"language-js\">const http2 = require('http2');\nconst fs = require('fs');\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>",
              "type": "module",
              "displayName": "Client-side example"
            },
            {
              "textRaw": "Headers object",
              "name": "headers_object",
              "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>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-js\">const http2 = require('http2');\nconst server = http2.createServer();\nserver.on('stream', (stream, headers) => {\n  console.log(headers[':path']);\n  console.log(headers.ABC);\n});\n</code></pre>",
              "type": "module",
              "displayName": "Headers object"
            },
            {
              "textRaw": "Settings object",
              "name": "settings_object",
              "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/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;number&gt;</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/en-US/docs/Web/JavaScript/Data_structures#Boolean_type\" class=\"type\">&lt;boolean&gt;</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/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;number&gt;</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/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;number&gt;</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/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;number&gt;</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/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;number&gt;</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>enableConnectProtocol</code><a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type\" class=\"type\">&lt;boolean&gt;</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</ul>\n<p>All additional properties on the settings object are ignored.</p>",
              "type": "module",
              "displayName": "Settings object"
            },
            {
              "textRaw": "Using `options.selectPadding()`",
              "name": "using_`options.selectpadding()`",
              "desc": "<p>When <code>options.paddingStrategy</code> is equal to\n<code>http2.constants.PADDING_STRATEGY_CALLBACK</code>, the HTTP/2 implementation will\nconsult the <code>options.selectPadding()</code> callback function, if provided, to\ndetermine the specific amount of padding to use per <code>HEADERS</code> and <code>DATA</code> frame.</p>\n<p>The <code>options.selectPadding()</code> function receives two numeric arguments,\n<code>frameLen</code> and <code>maxFrameLen</code> and must return a number <code>N</code> such that\n<code>frameLen &#x3C;= N &#x3C;= maxFrameLen</code>.</p>\n<pre><code class=\"language-js\">const http2 = require('http2');\nconst server = http2.createServer({\n  paddingStrategy: http2.constants.PADDING_STRATEGY_CALLBACK,\n  selectPadding(frameLen, maxFrameLen) {\n    return maxFrameLen;\n  }\n});\n</code></pre>\n<p>The <code>options.selectPadding()</code> function is invoked once for <em>every</em> <code>HEADERS</code> and\n<code>DATA</code> frame. This has a definite noticeable impact on performance.</p>",
              "type": "module",
              "displayName": "Using `options.selectPadding()`"
            },
            {
              "textRaw": "Error handling",
              "name": "error_handling",
              "desc": "<p>There are several types of error conditions that may arise when using the\n<code>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>",
              "type": "module",
              "displayName": "Error handling"
            },
            {
              "textRaw": "Invalid character handling in header names and values",
              "name": "invalid_character_handling_in_header_names_and_values",
              "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>",
              "type": "module",
              "displayName": "Invalid character handling in header names and values"
            },
            {
              "textRaw": "Push streams on the client",
              "name": "push_streams_on_the_client",
              "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-js\">const http2 = require('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>",
              "type": "module",
              "displayName": "Push streams on the client"
            },
            {
              "textRaw": "Supporting the `CONNECT` method",
              "name": "supporting_the_`connect`_method",
              "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-js\">const net = require('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-js\">const http2 = require('http2');\nconst { NGHTTP2_REFUSED_STREAM } = http2.constants;\nconst net = require('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-js\">const http2 = require('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:${port}`\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>",
              "type": "module",
              "displayName": "Supporting the `CONNECT` method"
            },
            {
              "textRaw": "The extended `CONNECT` protocol",
              "name": "the_extended_`connect`_protocol",
              "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-js\">const http2 = require('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-js\">const http2 = require('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>",
              "type": "module",
              "displayName": "The extended `CONNECT` protocol"
            }
          ],
          "classes": [
            {
              "textRaw": "Class: `Http2Session`",
              "type": "class",
              "name": "Http2Session",
              "meta": {
                "added": [
                  "v8.4.0"
                ],
                "changes": []
              },
              "desc": "<ul>\n<li>Extends: <a href=\"events.html#events_class_eventemitter\" class=\"type\">&lt;EventEmitter&gt;</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",
                  "desc": "<p>Every <code>Http2Session</code> instance is associated with exactly one <a href=\"net.html#net_class_net_socket\"><code>net.Socket</code></a> or\n<a href=\"tls.html#tls_class_tls_tlssocket\"><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>",
                  "type": "module",
                  "displayName": "`Http2Session` and sockets"
                }
              ],
              "events": [
                {
                  "textRaw": "Event: `'close'`",
                  "type": "event",
                  "name": "close",
                  "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'`",
                  "type": "event",
                  "name": "connect",
                  "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'`",
                  "type": "event",
                  "name": "error",
                  "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'`",
                  "type": "event",
                  "name": "frameError",
                  "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'`",
                  "type": "event",
                  "name": "goaway",
                  "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'`",
                  "type": "event",
                  "name": "localSettings",
                  "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'`",
                  "type": "event",
                  "name": "ping",
                  "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'`",
                  "type": "event",
                  "name": "remoteSettings",
                  "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'`",
                  "type": "event",
                  "name": "stream",
                  "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` {Array} An array containing the raw header names followed by their respective values.",
                      "name": "rawHeaders",
                      "type": "Array",
                      "desc": "An array containing the raw header names followed by their respective values."
                    }
                  ],
                  "desc": "<p>The <code>'stream'</code> event is emitted when a new <code>Http2Stream</code> is created.</p>\n<pre><code class=\"language-js\">const http2 = require('http2');\nsession.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'\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-js\">const http2 = require('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',\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(80);\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'`",
                  "type": "event",
                  "name": "timeout",
                  "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": "`alpnProtocol` {string|undefined}",
                  "type": "string|undefined",
                  "name": "alpnProtocol",
                  "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": "`closed` {boolean}",
                  "type": "boolean",
                  "name": "closed",
                  "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": "`connecting` {boolean}",
                  "type": "boolean",
                  "name": "connecting",
                  "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": "`destroyed` {boolean}",
                  "type": "boolean",
                  "name": "destroyed",
                  "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": "`encrypted` {boolean|undefined}",
                  "type": "boolean|undefined",
                  "name": "encrypted",
                  "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": "`localSettings` {HTTP/2 Settings Object}",
                  "type": "HTTP/2 Settings Object",
                  "name": "localSettings",
                  "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": "`originSet` {string[]|undefined}",
                  "type": "string[]|undefined",
                  "name": "originSet",
                  "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": "`pendingSettingsAck` {boolean}",
                  "type": "boolean",
                  "name": "pendingSettingsAck",
                  "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": "`remoteSettings` {HTTP/2 Settings Object}",
                  "type": "HTTP/2 Settings Object",
                  "name": "remoteSettings",
                  "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": "`socket` {net.Socket|tls.TLSSocket}",
                  "type": "net.Socket|tls.TLSSocket",
                  "name": "socket",
                  "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=\"http2.html#http2_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": "`http2session.state`",
                  "name": "state",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>Provides miscellaneous information about the current state of the\n<code>Http2Session</code>.</p>\n<ul>\n<li>\n<p><a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object\" class=\"type\">&lt;Object&gt;</a></p>\n<ul>\n<li><code>effectiveLocalWindowSize</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;number&gt;</a> The current local (receive)\nflow control window size for the <code>Http2Session</code>.</li>\n<li><code>effectiveRecvDataLength</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;number&gt;</a> The current number of bytes\nthat have been received since the last flow control <code>WINDOW_UPDATE</code>.</li>\n<li><code>nextStreamID</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;number&gt;</a> The numeric identifier to be used the\nnext time a new <code>Http2Stream</code> is created by this <code>Http2Session</code>.</li>\n<li><code>localWindowSize</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;number&gt;</a> The number of bytes that the remote peer can\nsend without receiving a <code>WINDOW_UPDATE</code>.</li>\n<li><code>lastProcStreamID</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;number&gt;</a> The numeric id of the <code>Http2Stream</code>\nfor which a <code>HEADERS</code> or <code>DATA</code> frame was most recently received.</li>\n<li><code>remoteWindowSize</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;number&gt;</a> The number of bytes that this <code>Http2Session</code>\nmay send without receiving a <code>WINDOW_UPDATE</code>.</li>\n<li><code>outboundQueueSize</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;number&gt;</a> The number of frames currently within the\noutbound queue for this <code>Http2Session</code>.</li>\n<li><code>deflateDynamicTableSize</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;number&gt;</a> The current size in bytes of the\noutbound header compression state table.</li>\n<li><code>inflateDynamicTableSize</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;number&gt;</a> The current size in bytes of the\ninbound header compression state table.</li>\n</ul>\n</li>\n</ul>\n<p>An object describing the current status of this <code>Http2Session</code>.</p>"
                },
                {
                  "textRaw": "`type` {number}",
                  "type": "number",
                  "name": "type",
                  "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])`",
                  "type": "method",
                  "name": "close",
                  "meta": {
                    "added": [
                      "v9.4.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`callback` {Function}",
                          "name": "callback",
                          "type": "Function"
                        }
                      ]
                    }
                  ],
                  "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])`",
                  "type": "method",
                  "name": "destroy",
                  "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."
                        },
                        {
                          "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`."
                        }
                      ]
                    }
                  ],
                  "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]]])`",
                  "type": "method",
                  "name": "goaway",
                  "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"
                        },
                        {
                          "textRaw": "`lastStreamID` {number} The numeric ID of the last processed `Http2Stream`",
                          "name": "lastStreamID",
                          "type": "number",
                          "desc": "The numeric ID of the last processed `Http2Stream`"
                        },
                        {
                          "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."
                        }
                      ]
                    }
                  ],
                  "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)`",
                  "type": "method",
                  "name": "ping",
                  "meta": {
                    "added": [
                      "v8.9.3"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "return": {
                        "textRaw": "Returns: {boolean}",
                        "name": "return",
                        "type": "boolean"
                      },
                      "params": [
                        {
                          "textRaw": "`payload` {Buffer|TypedArray|DataView} Optional ping payload.",
                          "name": "payload",
                          "type": "Buffer|TypedArray|DataView",
                          "desc": "Optional ping payload."
                        },
                        {
                          "textRaw": "`callback` {Function}",
                          "name": "callback",
                          "type": "Function"
                        }
                      ]
                    }
                  ],
                  "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()`",
                  "type": "method",
                  "name": "ref",
                  "meta": {
                    "added": [
                      "v9.4.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": []
                    }
                  ],
                  "desc": "<p>Calls <a href=\"net.html#net_socket_ref\"><code>ref()</code></a> on this <code>Http2Session</code>\ninstance's underlying <a href=\"net.html#net_class_net_socket\"><code>net.Socket</code></a>.</p>"
                },
                {
                  "textRaw": "`http2session.setTimeout(msecs, callback)`",
                  "type": "method",
                  "name": "setTimeout",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "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])`",
                  "type": "method",
                  "name": "settings",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`settings` {HTTP/2 Settings Object}",
                          "name": "settings",
                          "type": "HTTP/2 Settings Object"
                        },
                        {
                          "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"
                            }
                          ]
                        }
                      ]
                    }
                  ],
                  "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()`",
                  "type": "method",
                  "name": "unref",
                  "meta": {
                    "added": [
                      "v9.4.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": []
                    }
                  ],
                  "desc": "<p>Calls <a href=\"net.html#net_socket_unref\"><code>unref()</code></a> on this <code>Http2Session</code>\ninstance's underlying <a href=\"net.html#net_class_net_socket\"><code>net.Socket</code></a>.</p>"
                }
              ]
            },
            {
              "textRaw": "Class: `ServerHttp2Session`",
              "type": "class",
              "name": "ServerHttp2Session",
              "meta": {
                "added": [
                  "v8.4.0"
                ],
                "changes": []
              },
              "desc": "<ul>\n<li>Extends: <a href=\"http2.html#http2_class_http2session\" class=\"type\">&lt;Http2Session&gt;</a></li>\n</ul>",
              "methods": [
                {
                  "textRaw": "`serverhttp2session.altsvc(alt, originOrStream)`",
                  "type": "method",
                  "name": "altsvc",
                  "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-js\">const http2 = require('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)`",
                  "type": "method",
                  "name": "origin",
                  "meta": {
                    "added": [
                      "v10.12.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`origins` { string | URL | Object } One or more URL Strings passed as separate arguments.",
                          "name": "origins",
                          "type": " string | URL | Object ",
                          "desc": "One or more URL Strings passed as separate arguments."
                        }
                      ]
                    }
                  ],
                  "desc": "<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-js\">const http2 = require('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-js\">const http2 = require('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",
                  "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>",
                  "type": "module",
                  "displayName": "Specifying alternative services"
                }
              ]
            },
            {
              "textRaw": "Class: `ClientHttp2Session`",
              "type": "class",
              "name": "ClientHttp2Session",
              "meta": {
                "added": [
                  "v8.4.0"
                ],
                "changes": []
              },
              "desc": "<ul>\n<li>Extends: <a href=\"http2.html#http2_class_http2session\" class=\"type\">&lt;Http2Session&gt;</a></li>\n</ul>",
              "events": [
                {
                  "textRaw": "Event: `'altsvc'`",
                  "type": "event",
                  "name": "altsvc",
                  "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-js\">const http2 = require('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'`",
                  "type": "event",
                  "name": "origin",
                  "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-js\">const http2 = require('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])`",
                  "type": "method",
                  "name": "request",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "return": {
                        "textRaw": "Returns: {ClientHttp2Stream}",
                        "name": "return",
                        "type": "ClientHttp2Stream"
                      },
                      "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": "`weight` {number} Specifies the relative dependency of a stream in relation to other streams with the same `parent`. The value is a number between `1` and `256` (inclusive).",
                              "name": "weight",
                              "type": "number",
                              "desc": "Specifies the relative dependency of a stream in relation to other streams with the same `parent`. The value is a number between `1` and `256` (inclusive)."
                            },
                            {
                              "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."
                            }
                          ]
                        }
                      ]
                    }
                  ],
                  "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>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-js\">const http2 = require('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>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`",
              "type": "class",
              "name": "Http2Stream",
              "meta": {
                "added": [
                  "v8.4.0"
                ],
                "changes": []
              },
              "desc": "<ul>\n<li>Extends: <a href=\"stream.html#stream_class_stream_duplex\" class=\"type\">&lt;stream.Duplex&gt;</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=\"http2.html#http2_class_serverhttp2stream\"><code>ServerHttp2Stream</code></a> and\n<a href=\"http2.html#http2_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#stream_class_stream_duplex\"><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>",
              "modules": [
                {
                  "textRaw": "`Http2Stream` Lifecycle",
                  "name": "`http2stream`_lifecycle",
                  "modules": [
                    {
                      "textRaw": "Creation",
                      "name": "creation",
                      "desc": "<p>On the server side, instances of <a href=\"http2.html#http2_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=\"http2.html#http2_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>",
                      "type": "module",
                      "displayName": "Creation"
                    },
                    {
                      "textRaw": "Destruction",
                      "name": "destruction",
                      "desc": "<p>All <a href=\"http2.html#http2_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 pending data has been read.</li>\n<li>The <code>http2stream.close()</code> method is called, and pending 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>",
                      "type": "module",
                      "displayName": "Destruction"
                    }
                  ],
                  "type": "module",
                  "displayName": "`Http2Stream` Lifecycle"
                }
              ],
              "events": [
                {
                  "textRaw": "Event: `'aborted'`",
                  "type": "event",
                  "name": "aborted",
                  "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'`",
                  "type": "event",
                  "name": "close",
                  "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'`",
                  "type": "event",
                  "name": "error",
                  "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'`",
                  "type": "event",
                  "name": "frameError",
                  "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: `'timeout'`",
                  "type": "event",
                  "name": "timeout",
                  "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'`",
                  "type": "event",
                  "name": "trailers",
                  "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"
                    }
                  ],
                  "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\n<a href=\"http2.html#http2_headers_object\">HTTP/2 Headers Object</a> and flags associated with the headers.</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'`",
                  "type": "event",
                  "name": "wantTrailers",
                  "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": "`aborted` {boolean}",
                  "type": "boolean",
                  "name": "aborted",
                  "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": "`bufferSize` {number}",
                  "type": "number",
                  "name": "bufferSize",
                  "meta": {
                    "added": [
                      "v11.2.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>This property shows the number of characters currently buffered to be written.\nSee <a href=\"net.html#net_socket_buffersize\"><code>net.Socket.bufferSize</code></a> for details.</p>"
                },
                {
                  "textRaw": "`closed` {boolean}",
                  "type": "boolean",
                  "name": "closed",
                  "meta": {
                    "added": [
                      "v9.4.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>Set to <code>true</code> if the <code>Http2Stream</code> instance has been closed.</p>"
                },
                {
                  "textRaw": "`destroyed` {boolean}",
                  "type": "boolean",
                  "name": "destroyed",
                  "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": "`endAfterHeaders` {boolean}",
                  "type": "boolean",
                  "name": "endAfterHeaders",
                  "meta": {
                    "added": [
                      "v10.11.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>Set the <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": "`id` {number|undefined}",
                  "type": "number|undefined",
                  "name": "id",
                  "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": "`pending` {boolean}",
                  "type": "boolean",
                  "name": "pending",
                  "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": "`rstCode` {number}",
                  "type": "number",
                  "name": "rstCode",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>Set to the <code>RST_STREAM</code> <a href=\"http2.html#error_codes\">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": "`sentHeaders` {HTTP/2 Headers Object}",
                  "type": "HTTP/2 Headers Object",
                  "name": "sentHeaders",
                  "meta": {
                    "added": [
                      "v9.5.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>An object containing the outbound headers sent for this <code>Http2Stream</code>.</p>"
                },
                {
                  "textRaw": "`sentInfoHeaders` {HTTP/2 Headers Object[]}",
                  "type": "HTTP/2 Headers Object[]",
                  "name": "sentInfoHeaders",
                  "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": "`sentTrailers` {HTTP/2 Headers Object}",
                  "type": "HTTP/2 Headers Object",
                  "name": "sentTrailers",
                  "meta": {
                    "added": [
                      "v9.5.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>An object containing the outbound trailers sent for this <code>HttpStream</code>.</p>"
                },
                {
                  "textRaw": "`session` {Http2Session}",
                  "type": "Http2Session",
                  "name": "session",
                  "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": "`http2stream.state`",
                  "name": "state",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>Provides miscellaneous information about the current state of the\n<code>Http2Stream</code>.</p>\n<ul>\n<li>\n<p><a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object\" class=\"type\">&lt;Object&gt;</a></p>\n<ul>\n<li><code>localWindowSize</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;number&gt;</a> The number of bytes the connected peer may send\nfor this <code>Http2Stream</code> without receiving a <code>WINDOW_UPDATE</code>.</li>\n<li><code>state</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;number&gt;</a> A flag indicating the low-level current state of the\n<code>Http2Stream</code> as determined by <code>nghttp2</code>.</li>\n<li><code>localClose</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;number&gt;</a> <code>1</code> if this <code>Http2Stream</code> has been closed locally.</li>\n<li><code>remoteClose</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;number&gt;</a> <code>1</code> if this <code>Http2Stream</code> has been closed\nremotely.</li>\n<li><code>sumDependencyWeight</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;number&gt;</a> The sum weight of all <code>Http2Stream</code>\ninstances that depend on this <code>Http2Stream</code> as specified using\n<code>PRIORITY</code> frames.</li>\n<li><code>weight</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;number&gt;</a> The priority weight of this <code>Http2Stream</code>.</li>\n</ul>\n</li>\n</ul>\n<p>A current state of this <code>Http2Stream</code>.</p>"
                }
              ],
              "methods": [
                {
                  "textRaw": "`http2stream.close(code[, callback])`",
                  "type": "method",
                  "name": "close",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "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."
                        }
                      ]
                    }
                  ],
                  "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)`",
                  "type": "method",
                  "name": "priority",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`options` {Object}",
                          "name": "options",
                          "type": "Object",
                          "options": [
                            {
                              "textRaw": "`exclusive` {boolean} When `true` and `parent` identifies a parent Stream, this stream is made the sole direct dependency of the parent, with all other existing dependents made a dependent of this stream. **Default:** `false`.",
                              "name": "exclusive",
                              "type": "boolean",
                              "default": "`false`",
                              "desc": "When `true` and `parent` identifies a parent Stream, this stream is made the sole direct dependency of the parent, with all other existing dependents made a dependent of this stream."
                            },
                            {
                              "textRaw": "`parent` {number} Specifies the numeric identifier of a stream this stream is dependent on.",
                              "name": "parent",
                              "type": "number",
                              "desc": "Specifies the numeric identifier of a stream this stream is dependent on."
                            },
                            {
                              "textRaw": "`weight` {number} Specifies the relative dependency of a stream in relation to other streams with the same `parent`. The value is a number between `1` and `256` (inclusive).",
                              "name": "weight",
                              "type": "number",
                              "desc": "Specifies the relative dependency of a stream in relation to other streams with the same `parent`. The value is a number between `1` and `256` (inclusive)."
                            },
                            {
                              "textRaw": "`silent` {boolean} When `true`, changes the priority locally without sending a `PRIORITY` frame to the connected peer.",
                              "name": "silent",
                              "type": "boolean",
                              "desc": "When `true`, changes the priority locally without sending a `PRIORITY` frame to the connected peer."
                            }
                          ]
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Updates the priority for this <code>Http2Stream</code> instance.</p>"
                },
                {
                  "textRaw": "`http2stream.setTimeout(msecs, callback)`",
                  "type": "method",
                  "name": "setTimeout",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`msecs` {number}",
                          "name": "msecs",
                          "type": "number"
                        },
                        {
                          "textRaw": "`callback` {Function}",
                          "name": "callback",
                          "type": "Function"
                        }
                      ]
                    }
                  ],
                  "desc": "<pre><code class=\"language-js\">const http2 = require('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)`",
                  "type": "method",
                  "name": "sendTrailers",
                  "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-js\">const http2 = require('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`",
              "type": "class",
              "name": "ClientHttp2Stream",
              "meta": {
                "added": [
                  "v8.4.0"
                ],
                "changes": []
              },
              "desc": "<ul>\n<li>Extends <a href=\"http2.html#http2_class_http2stream\" class=\"type\">&lt;Http2Stream&gt;</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'`",
                  "type": "event",
                  "name": "continue",
                  "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'`",
                  "type": "event",
                  "name": "headers",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "params": [],
                  "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=\"http2.html#http2_headers_object\">HTTP/2 Headers Object</a> and flags\nassociated with the headers.</p>\n<pre><code class=\"language-js\">stream.on('headers', (headers, flags) => {\n  console.log(headers);\n});\n</code></pre>"
                },
                {
                  "textRaw": "Event: `'push'`",
                  "type": "event",
                  "name": "push",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "params": [],
                  "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=\"http2.html#http2_headers_object\">HTTP/2 Headers Object</a> and\nflags associated with the headers.</p>\n<pre><code class=\"language-js\">stream.on('push', (headers, flags) => {\n  console.log(headers);\n});\n</code></pre>"
                },
                {
                  "textRaw": "Event: `'response'`",
                  "type": "event",
                  "name": "response",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "params": [],
                  "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 two arguments: an <code>Object</code> containing the received\n<a href=\"http2.html#http2_headers_object\">HTTP/2 Headers Object</a>, and flags associated with the headers.</p>\n<pre><code class=\"language-js\">const http2 = require('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`",
              "type": "class",
              "name": "ServerHttp2Stream",
              "meta": {
                "added": [
                  "v8.4.0"
                ],
                "changes": []
              },
              "desc": "<ul>\n<li>Extends: <a href=\"http2.html#http2_class_http2stream\" class=\"type\">&lt;Http2Stream&gt;</a></li>\n</ul>\n<p>The <code>ServerHttp2Stream</code> class is an extension of <a href=\"http2.html#http2_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)`",
                  "type": "method",
                  "name": "additionalHeaders",
                  "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)`",
                  "type": "method",
                  "name": "pushStream",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "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."
                            }
                          ]
                        },
                        {
                          "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-js\">const http2 = require('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]])`",
                  "type": "method",
                  "name": "respond",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "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} 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."
                            }
                          ]
                        }
                      ]
                    }
                  ],
                  "desc": "<pre><code class=\"language-js\">const http2 = require('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>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-js\">const http2 = require('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]])`",
                  "type": "method",
                  "name": "respondWithFD",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": [
                      {
                        "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"
                        },
                        {
                          "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."
                            }
                          ]
                        }
                      ]
                    }
                  ],
                  "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-js\">const http2 = require('http2');\nconst fs = require('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'\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-js\">const http2 = require('http2');\nconst fs = require('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'\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]])`",
                  "type": "method",
                  "name": "respondWithFile",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": [
                      {
                        "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"
                        },
                        {
                          "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."
                            }
                          ]
                        }
                      ]
                    }
                  ],
                  "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-js\">const http2 = require('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    if (err.code === 'ENOENT') {\n      stream.respond({ ':status': 404 });\n    } else {\n      stream.respond({ ':status': 500 });\n    }\n    stream.end();\n  }\n\n  stream.respondWithFile('/some/file',\n                         { 'content-type': 'text/plain' },\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-js\">const http2 = require('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' },\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-js\">const http2 = require('http2');\nconst server = http2.createServer();\nserver.on('stream', (stream) => {\n  stream.respondWithFile('/some/file',\n                         { 'content-type': 'text/plain' },\n                         { waitForTrailers: true });\n  stream.on('wantTrailers', () => {\n    stream.sendTrailers({ ABC: 'some value to send' });\n  });\n});\n</code></pre>"
                }
              ],
              "properties": [
                {
                  "textRaw": "`headersSent` {boolean}",
                  "type": "boolean",
                  "name": "headersSent",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>True if headers were sent, false otherwise (read-only).</p>"
                },
                {
                  "textRaw": "`pushAllowed` {boolean}",
                  "type": "boolean",
                  "name": "pushAllowed",
                  "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`",
              "type": "class",
              "name": "Http2Server",
              "meta": {
                "added": [
                  "v8.4.0"
                ],
                "changes": []
              },
              "desc": "<ul>\n<li>Extends: <a href=\"net.html#net_class_net_server\" class=\"type\">&lt;net.Server&gt;</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 <code>http2</code>\nmodule.</p>",
              "events": [
                {
                  "textRaw": "Event: `'checkContinue'`",
                  "type": "event",
                  "name": "checkContinue",
                  "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=\"http2.html#http2_event_request\"><code>'request'</code></a> listener is registered or <a href=\"http2.html#http2_http2_createserver_options_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=\"http2.html#http2_response_writecontinue\"><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=\"http2.html#http2_event_request\"><code>'request'</code></a> event will\nnot be emitted.</p>"
                },
                {
                  "textRaw": "Event: `'request'`",
                  "type": "event",
                  "name": "request",
                  "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=\"http2.html#http2_compatibility_api\">Compatibility API</a>.</p>"
                },
                {
                  "textRaw": "Event: `'session'`",
                  "type": "event",
                  "name": "session",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "params": [],
                  "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'`",
                  "type": "event",
                  "name": "sessionError",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "params": [],
                  "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'`",
                  "type": "event",
                  "name": "stream",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "params": [],
                  "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<pre><code class=\"language-js\">const http2 = require('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'\n  });\n  stream.write('hello ');\n  stream.end('world');\n});\n</code></pre>"
                },
                {
                  "textRaw": "Event: `'timeout'`",
                  "type": "event",
                  "name": "timeout",
                  "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>http2server.setTimeout()</code>.\n<strong>Default:</strong> 2 minutes.</p>\n<p>To change the default timeout use the <a href=\"cli.html#cli_http_server_default_timeout_milliseconds\"><code>--http-server-default-timeout</code></a>\nflag.</p>"
                }
              ],
              "methods": [
                {
                  "textRaw": "`server.close([callback])`",
                  "type": "method",
                  "name": "close",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`callback` {Function}",
                          "name": "callback",
                          "type": "Function"
                        }
                      ]
                    }
                  ],
                  "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=\"http2.html#http2_http2session_close_callback\"><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#net_server_close_callback\"><code>net.Server.close()</code></a> for more details.</p>"
                },
                {
                  "textRaw": "`server.setTimeout([msecs][, callback])`",
                  "type": "method",
                  "name": "setTimeout",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "return": {
                        "textRaw": "Returns: {Http2Server}",
                        "name": "return",
                        "type": "Http2Server"
                      },
                      "params": [
                        {
                          "textRaw": "`msecs` {number} **Default:** `120000` (2 minutes)",
                          "name": "msecs",
                          "type": "number",
                          "default": "`120000` (2 minutes)"
                        },
                        {
                          "textRaw": "`callback` {Function}",
                          "name": "callback",
                          "type": "Function"
                        }
                      ]
                    }
                  ],
                  "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 of no callback function were assigned, a new <code>ERR_INVALID_CALLBACK</code>\nerror will be thrown.</p>\n<p>To change the default timeout use the <a href=\"cli.html#cli_http_server_default_timeout_milliseconds\"><code>--http-server-default-timeout</code></a>\nflag.</p>"
                }
              ]
            },
            {
              "textRaw": "Class: `Http2SecureServer`",
              "type": "class",
              "name": "Http2SecureServer",
              "meta": {
                "added": [
                  "v8.4.0"
                ],
                "changes": []
              },
              "desc": "<ul>\n<li>Extends: <a href=\"tls.html#tls_class_tls_server\" class=\"type\">&lt;tls.Server&gt;</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>http2</code> module.</p>",
              "events": [
                {
                  "textRaw": "Event: `'checkContinue'`",
                  "type": "event",
                  "name": "checkContinue",
                  "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=\"http2.html#http2_event_request\"><code>'request'</code></a> listener is registered or <a href=\"http2.html#http2_http2_createsecureserver_options_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=\"http2.html#http2_response_writecontinue\"><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=\"http2.html#http2_event_request\"><code>'request'</code></a> event will\nnot be emitted.</p>"
                },
                {
                  "textRaw": "Event: `'request'`",
                  "type": "event",
                  "name": "request",
                  "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=\"http2.html#http2_compatibility_api\">Compatibility API</a>.</p>"
                },
                {
                  "textRaw": "Event: `'session'`",
                  "type": "event",
                  "name": "session",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "params": [],
                  "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'`",
                  "type": "event",
                  "name": "sessionError",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "params": [],
                  "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'`",
                  "type": "event",
                  "name": "stream",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "params": [],
                  "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<pre><code class=\"language-js\">const http2 = require('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'\n  });\n  stream.write('hello ');\n  stream.end('world');\n});\n</code></pre>"
                },
                {
                  "textRaw": "Event: `'timeout'`",
                  "type": "event",
                  "name": "timeout",
                  "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'`",
                  "type": "event",
                  "name": "unknownProtocol",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "params": [],
                  "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. See the <a href=\"http2.html#http2_compatibility_api\">Compatibility API</a>.</p>"
                }
              ],
              "methods": [
                {
                  "textRaw": "`server.close([callback])`",
                  "type": "method",
                  "name": "close",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`callback` {Function}",
                          "name": "callback",
                          "type": "Function"
                        }
                      ]
                    }
                  ],
                  "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=\"http2.html#http2_http2session_close_callback\"><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#tls_server_close_callback\"><code>tls.Server.close()</code></a> for more details.</p>"
                },
                {
                  "textRaw": "`server.setTimeout([msecs][, callback])`",
                  "type": "method",
                  "name": "setTimeout",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "return": {
                        "textRaw": "Returns: {Http2SecureServer}",
                        "name": "return",
                        "type": "Http2SecureServer"
                      },
                      "params": [
                        {
                          "textRaw": "`msecs` {number} **Default:** `120000` (2 minutes)",
                          "name": "msecs",
                          "type": "number",
                          "default": "`120000` (2 minutes)"
                        },
                        {
                          "textRaw": "`callback` {Function}",
                          "name": "callback",
                          "type": "Function"
                        }
                      ]
                    }
                  ],
                  "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 of no callback function were assigned, a new <code>ERR_INVALID_CALLBACK</code>\nerror will be thrown.</p>"
                }
              ]
            }
          ],
          "methods": [
            {
              "textRaw": "`http2.createServer(options[, onRequestHandler])`",
              "type": "method",
              "name": "createServer",
              "meta": {
                "added": [
                  "v8.4.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v12.18.0"
                    ],
                    "pr-url": "https://github.com/nodejs-private/node-private/pull/206",
                    "description": "Added `maxSettings` option with a default of 32."
                  },
                  {
                    "version": "v12.16.0",
                    "pr-url": "https://github.com/nodejs/node/pull/30534",
                    "description": "Added `maxSessionRejectedStreams` option with a default of 100."
                  },
                  {
                    "version": "v12.16.0",
                    "pr-url": "https://github.com/nodejs/node/pull/30534",
                    "description": "Added `maxSessionInvalidFrames` option with a default of 1000."
                  },
                  {
                    "version": "v12.4.0",
                    "pr-url": "https://github.com/nodejs/node/pull/27782",
                    "description": "The `options` parameter now supports `net.createServer()` options."
                  },
                  {
                    "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."
                  },
                  {
                    "version": "v9.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/15752",
                    "description": "Added the `Http1IncomingMessage` and `Http1ServerResponse` option."
                  }
                ]
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Http2Server}",
                    "name": "return",
                    "type": "Http2Server"
                  },
                  "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 [`http.Server#maxHeadersCount`][] or [`http.ClientRequest#maxHeadersCount`][]. 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 [`http.Server#maxHeadersCount`][] or [`http.ClientRequest#maxHeadersCount`][]. 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} 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`: Specifies that no padding is to be applied.",
                              "name": "http2.constants.PADDING_STRATEGY_NONE",
                              "desc": "Specifies that no padding is to be applied."
                            },
                            {
                              "textRaw": "`http2.constants.PADDING_STRATEGY_MAX`: Specifies that the maximum amount of padding, as determined by the internal implementation, is to be applied.",
                              "name": "http2.constants.PADDING_STRATEGY_MAX",
                              "desc": "Specifies that the maximum amount of padding, as determined by the internal implementation, is to be applied."
                            },
                            {
                              "textRaw": "`http2.constants.PADDING_STRATEGY_CALLBACK`: Specifies that the user provided `options.selectPadding()` callback is to be used to determine the amount of padding.",
                              "name": "http2.constants.PADDING_STRATEGY_CALLBACK",
                              "desc": "Specifies that the user provided `options.selectPadding()` callback is to be used to determine the amount of padding."
                            },
                            {
                              "textRaw": "`http2.constants.PADDING_STRATEGY_ALIGNED`: Will *attempt* to apply enough padding to ensure that the total frame length, including the 9-byte header, is a multiple of 8. For each frame, however, 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 will be used and the total frame length will *not* necessarily be aligned at 8 bytes.",
                              "name": "http2.constants.PADDING_STRATEGY_ALIGNED",
                              "desc": "Will *attempt* to apply enough padding to ensure that the total frame length, including the 9-byte header, is a multiple of 8. For each frame, however, 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 will be used and the total frame length will *not* necessarily be 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": "`selectPadding` {Function} When `options.paddingStrategy` is equal to `http2.constants.PADDING_STRATEGY_CALLBACK`, provides the callback function used to determine the padding. See [Using `options.selectPadding()`][].",
                          "name": "selectPadding",
                          "type": "Function",
                          "desc": "When `options.paddingStrategy` is equal to `http2.constants.PADDING_STRATEGY_CALLBACK`, provides the callback function used to determine the padding. See [Using `options.selectPadding()`][]."
                        },
                        {
                          "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": "`Http1IncomingMessage` {http.IncomingMessage} Specifies the `IncomingMessage` class to used for HTTP/1 fallback. Useful for extending the original `http.IncomingMessage`. **Default:** `http.IncomingMessage`.",
                          "name": "Http1IncomingMessage",
                          "type": "http.IncomingMessage",
                          "default": "`http.IncomingMessage`",
                          "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`.",
                          "name": "Http1ServerResponse",
                          "type": "http.ServerResponse",
                          "default": "`http.ServerResponse`",
                          "desc": "Specifies the `ServerResponse` class to used for HTTP/1 fallback. Useful for extending the original `http.ServerResponse`."
                        },
                        {
                          "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": "...: Any [`net.createServer()`][] option can be provided.",
                          "name": "...",
                          "desc": "Any [`net.createServer()`][] option can be provided."
                        }
                      ]
                    },
                    {
                      "textRaw": "`onRequestHandler` {Function} See [Compatibility API][]",
                      "name": "onRequestHandler",
                      "type": "Function",
                      "desc": "See [Compatibility API][]"
                    }
                  ]
                }
              ],
              "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=\"http2.html#http2_http2_createsecureserver_options_onrequesthandler\"><code>http2.createSecureServer()</code></a> is necessary when communicating\nwith browser clients.</p>\n<pre><code class=\"language-js\">const http2 = require('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',\n    ':status': 200\n  });\n  stream.end('&#x3C;h1>Hello World&#x3C;/h1>');\n});\n\nserver.listen(80);\n</code></pre>"
            },
            {
              "textRaw": "`http2.createSecureServer(options[, onRequestHandler])`",
              "type": "method",
              "name": "createSecureServer",
              "meta": {
                "added": [
                  "v8.4.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v12.18.0"
                    ],
                    "pr-url": "https://github.com/nodejs-private/node-private/pull/206",
                    "description": "Added `maxSettings` option with a default of 32."
                  },
                  {
                    "version": "v12.16.0",
                    "pr-url": "https://github.com/nodejs/node/pull/30534",
                    "description": "Added `maxSessionRejectedStreams` option with a default of 100."
                  },
                  {
                    "version": "v12.16.0",
                    "pr-url": "https://github.com/nodejs/node/pull/30534",
                    "description": "Added `maxSessionInvalidFrames` option with a default of 1000."
                  },
                  {
                    "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": [
                {
                  "return": {
                    "textRaw": "Returns: {Http2SecureServer}",
                    "name": "return",
                    "type": "Http2SecureServer"
                  },
                  "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 [`http.Server#maxHeadersCount`][] or [`http.ClientRequest#maxHeadersCount`][]. 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 [`http.Server#maxHeadersCount`][] or [`http.ClientRequest#maxHeadersCount`][]. 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`: Specifies that no padding is to be applied.",
                              "name": "http2.constants.PADDING_STRATEGY_NONE",
                              "desc": "Specifies that no padding is to be applied."
                            },
                            {
                              "textRaw": "`http2.constants.PADDING_STRATEGY_MAX`: Specifies that the maximum amount of padding, as determined by the internal implementation, is to be applied.",
                              "name": "http2.constants.PADDING_STRATEGY_MAX",
                              "desc": "Specifies that the maximum amount of padding, as determined by the internal implementation, is to be applied."
                            },
                            {
                              "textRaw": "`http2.constants.PADDING_STRATEGY_CALLBACK`: Specifies that the user provided `options.selectPadding()` callback is to be used to determine the amount of padding.",
                              "name": "http2.constants.PADDING_STRATEGY_CALLBACK",
                              "desc": "Specifies that the user provided `options.selectPadding()` callback is to be used to determine the amount of padding."
                            },
                            {
                              "textRaw": "`http2.constants.PADDING_STRATEGY_ALIGNED`: Will *attempt* to apply enough padding to ensure that the total frame length, including the 9-byte header, is a multiple of 8. For each frame, however, 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 will be used and the total frame length will *not* necessarily be aligned at 8 bytes.",
                              "name": "http2.constants.PADDING_STRATEGY_ALIGNED",
                              "desc": "Will *attempt* to apply enough padding to ensure that the total frame length, including the 9-byte header, is a multiple of 8. For each frame, however, 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 will be used and the total frame length will *not* necessarily be 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": "`selectPadding` {Function} When `options.paddingStrategy` is equal to `http2.constants.PADDING_STRATEGY_CALLBACK`, provides the callback function used to determine the padding. See [Using `options.selectPadding()`][].",
                          "name": "selectPadding",
                          "type": "Function",
                          "desc": "When `options.paddingStrategy` is equal to `http2.constants.PADDING_STRATEGY_CALLBACK`, provides the callback function used to determine the padding. See [Using `options.selectPadding()`][]."
                        },
                        {
                          "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": "...: Any [`tls.createServer()`][] options can be provided. For servers, the identity options (`pfx` or `key`/`cert`) are usually required.",
                          "name": "...",
                          "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": "`onRequestHandler` {Function} See [Compatibility API][]",
                      "name": "onRequestHandler",
                      "type": "Function",
                      "desc": "See [Compatibility API][]"
                    }
                  ]
                }
              ],
              "desc": "<p>Returns a <code>tls.Server</code> instance that creates and manages <code>Http2Session</code>\ninstances.</p>\n<pre><code class=\"language-js\">const http2 = require('http2');\nconst fs = require('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',\n    ':status': 200\n  });\n  stream.end('&#x3C;h1>Hello World&#x3C;/h1>');\n});\n\nserver.listen(80);\n</code></pre>"
            },
            {
              "textRaw": "`http2.connect(authority[, options][, listener])`",
              "type": "method",
              "name": "connect",
              "meta": {
                "added": [
                  "v8.4.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v12.18.0"
                    ],
                    "pr-url": "https://github.com/nodejs-private/node-private/pull/206",
                    "description": "Added `maxSettings` option with a default of 32."
                  },
                  {
                    "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": [
                {
                  "return": {
                    "textRaw": "Returns: {ClientHttp2Session}",
                    "name": "return",
                    "type": "ClientHttp2Session"
                  },
                  "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 [`http.Server#maxHeadersCount`][] or [`http.ClientRequest#maxHeadersCount`][]. 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 [`http.Server#maxHeadersCount`][] or [`http.ClientRequest#maxHeadersCount`][]. 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`: Specifies that no padding is to be applied.",
                              "name": "http2.constants.PADDING_STRATEGY_NONE",
                              "desc": "Specifies that no padding is to be applied."
                            },
                            {
                              "textRaw": "`http2.constants.PADDING_STRATEGY_MAX`: Specifies that the maximum amount of padding, as determined by the internal implementation, is to be applied.",
                              "name": "http2.constants.PADDING_STRATEGY_MAX",
                              "desc": "Specifies that the maximum amount of padding, as determined by the internal implementation, is to be applied."
                            },
                            {
                              "textRaw": "`http2.constants.PADDING_STRATEGY_CALLBACK`: Specifies that the user provided `options.selectPadding()` callback is to be used to determine the amount of padding.",
                              "name": "http2.constants.PADDING_STRATEGY_CALLBACK",
                              "desc": "Specifies that the user provided `options.selectPadding()` callback is to be used to determine the amount of padding."
                            },
                            {
                              "textRaw": "`http2.constants.PADDING_STRATEGY_ALIGNED`: Will *attempt* to apply enough padding to ensure that the total frame length, including the 9-byte header, is a multiple of 8. For each frame, however, 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 will be used and the total frame length will *not* necessarily be aligned at 8 bytes.",
                              "name": "http2.constants.PADDING_STRATEGY_ALIGNED",
                              "desc": "Will *attempt* to apply enough padding to ensure that the total frame length, including the 9-byte header, is a multiple of 8. For each frame, however, 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 will be used and the total frame length will *not* necessarily be 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": "`selectPadding` {Function} When `options.paddingStrategy` is equal to `http2.constants.PADDING_STRATEGY_CALLBACK`, provides the callback function used to determine the padding. See [Using `options.selectPadding()`][].",
                          "name": "selectPadding",
                          "type": "Function",
                          "desc": "When `options.paddingStrategy` is equal to `http2.constants.PADDING_STRATEGY_CALLBACK`, provides the callback function used to determine the padding. See [Using `options.selectPadding()`][]."
                        },
                        {
                          "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": "`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": "...: Any [`net.connect()`][] or [`tls.connect()`][] options can be provided.",
                          "name": "...",
                          "desc": "Any [`net.connect()`][] or [`tls.connect()`][] options can be provided."
                        }
                      ]
                    },
                    {
                      "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."
                    }
                  ]
                }
              ],
              "desc": "<p>Returns a <code>ClientHttp2Session</code> instance.</p>\n<pre><code class=\"language-js\">const http2 = require('http2');\nconst client = http2.connect('https://localhost:1234');\n\n/* Use the client */\n\nclient.close();\n</code></pre>"
            },
            {
              "textRaw": "`http2.getDefaultSettings()`",
              "type": "method",
              "name": "getDefaultSettings",
              "meta": {
                "added": [
                  "v8.4.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {HTTP/2 Settings Object}",
                    "name": "return",
                    "type": "HTTP/2 Settings Object"
                  },
                  "params": []
                }
              ],
              "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])`",
              "type": "method",
              "name": "getPackedSettings",
              "meta": {
                "added": [
                  "v8.4.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Buffer}",
                    "name": "return",
                    "type": "Buffer"
                  },
                  "params": [
                    {
                      "textRaw": "`settings` {HTTP/2 Settings Object}",
                      "name": "settings",
                      "type": "HTTP/2 Settings Object"
                    }
                  ]
                }
              ],
              "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-js\">const http2 = require('http2');\n\nconst packed = http2.getPackedSettings({ enablePush: false });\n\nconsole.log(packed.toString('base64'));\n// Prints: AAIAAAAA\n</code></pre>"
            },
            {
              "textRaw": "`http2.getUnpackedSettings(buf)`",
              "type": "method",
              "name": "getUnpackedSettings",
              "meta": {
                "added": [
                  "v8.4.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {HTTP/2 Settings Object}",
                    "name": "return",
                    "type": "HTTP/2 Settings Object"
                  },
                  "params": [
                    {
                      "textRaw": "`buf` {Buffer|Uint8Array} The packed settings.",
                      "name": "buf",
                      "type": "Buffer|Uint8Array",
                      "desc": "The packed settings."
                    }
                  ]
                }
              ],
              "desc": "<p>Returns a <a href=\"http2.html#http2_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>"
            }
          ],
          "properties": [
            {
              "textRaw": "`http2.constants`",
              "name": "constants",
              "meta": {
                "added": [
                  "v8.4.0"
                ],
                "changes": []
              },
              "modules": [
                {
                  "textRaw": "Error codes for `RST_STREAM` and `GOAWAY`",
                  "name": "error_codes_for_`rst_stream`_and_`goaway`",
                  "desc": "<p><a id=\"error_codes\"></a></p>\n<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>",
                  "type": "module",
                  "displayName": "Error codes for `RST_STREAM` and `GOAWAY`"
                }
              ]
            }
          ],
          "type": "module",
          "displayName": "Core API"
        },
        {
          "textRaw": "Compatibility API",
          "name": "compatibility_api",
          "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-js\">const http2 = require('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' });\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=\"http2.html#http2_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=\"http2.html#http2_class_http2_http2serverrequest\"><code>Http2ServerRequest</code></a> and\n<a href=\"http2.html#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",
              "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-js\">const { createSecureServer } = require('http2');\nconst { readFileSync } = require('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 a 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>",
              "type": "module",
              "displayName": "ALPN negotiation"
            }
          ],
          "classes": [
            {
              "textRaw": "Class: `http2.Http2ServerRequest`",
              "type": "class",
              "name": "http2.Http2ServerRequest",
              "meta": {
                "added": [
                  "v8.4.0"
                ],
                "changes": []
              },
              "desc": "<ul>\n<li>Extends: <a href=\"stream.html#stream_class_stream_readable\" class=\"type\">&lt;stream.Readable&gt;</a></li>\n</ul>\n<p>A <code>Http2ServerRequest</code> object is created by <a href=\"http2.html#http2_class_http2server\"><code>http2.Server</code></a> or\n<a href=\"http2.html#http2_class_http2secureserver\"><code>http2.SecureServer</code></a> and passed as the first argument to the\n<a href=\"http2.html#http2_event_request\"><code>'request'</code></a> event. It may be used to access a request status, headers, and\ndata.</p>",
              "events": [
                {
                  "textRaw": "Event: `'aborted'`",
                  "type": "event",
                  "name": "aborted",
                  "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'`",
                  "type": "event",
                  "name": "close",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "params": [],
                  "desc": "<p>Indicates that the underlying <a href=\"http2.html#http2_class_http2stream\"><code>Http2Stream</code></a> was closed.\nJust like <code>'end'</code>, this event occurs only once per response.</p>"
                }
              ],
              "properties": [
                {
                  "textRaw": "`aborted` {boolean}",
                  "type": "boolean",
                  "name": "aborted",
                  "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": "`authority` {string}",
                  "type": "string",
                  "name": "authority",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The request authority pseudo header field. It can also be accessed via\n<code>req.headers[':authority']</code>.</p>"
                },
                {
                  "textRaw": "`complete` {boolean}",
                  "type": "boolean",
                  "name": "complete",
                  "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": "`headers` {Object}",
                  "type": "Object",
                  "name": "headers",
                  "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=\"http2.html#http2_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": "`httpVersion` {string}",
                  "type": "string",
                  "name": "httpVersion",
                  "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": "`method` {string}",
                  "type": "string",
                  "name": "method",
                  "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": "`rawHeaders` {string[]}",
                  "type": "string[]",
                  "name": "rawHeaders",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "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": "`rawTrailers` {string[]}",
                  "type": "string[]",
                  "name": "rawTrailers",
                  "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": "`scheme` {string}",
                  "type": "string",
                  "name": "scheme",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The request scheme pseudo header field indicating the scheme\nportion of the target URL.</p>"
                },
                {
                  "textRaw": "`socket` {net.Socket|tls.TLSSocket}",
                  "type": "net.Socket|tls.TLSSocket",
                  "name": "socket",
                  "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=\"http2.html#http2_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#tls_tlssocket_getpeercertificate_detailed\"><code>request.socket.getPeerCertificate()</code></a> to obtain the client's\nauthentication details.</p>"
                },
                {
                  "textRaw": "`stream` {Http2Stream}",
                  "type": "Http2Stream",
                  "name": "stream",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The <a href=\"http2.html#http2_class_http2stream\"><code>Http2Stream</code></a> object backing the request.</p>"
                },
                {
                  "textRaw": "`trailers` {Object}",
                  "type": "Object",
                  "name": "trailers",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The request/response trailers object. Only populated at the <code>'end'</code> event.</p>"
                },
                {
                  "textRaw": "`url` {string}",
                  "type": "string",
                  "name": "url",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>Request URL string. This contains only the URL that is\npresent in the actual HTTP request. If the request is:</p>\n<pre><code class=\"language-http\">GET /status?name=ryan HTTP/1.1\\r\\n\nAccept: text/plain\\r\\n\n\\r\\n\n</code></pre>\n<p>Then <code>request.url</code> will be:</p>\n<!-- eslint-disable semi -->\n<pre><code class=\"language-js\">'/status?name=ryan'\n</code></pre>\n<p>To parse the url into its parts <code>require('url').parse(request.url)</code>\ncan be used:</p>\n<pre><code class=\"language-console\">$ node\n> require('url').parse('/status?name=ryan')\nUrl {\n  protocol: null,\n  slashes: null,\n  auth: null,\n  host: null,\n  port: null,\n  hostname: null,\n  hash: null,\n  search: '?name=ryan',\n  query: 'name=ryan',\n  pathname: '/status',\n  path: '/status?name=ryan',\n  href: '/status?name=ryan' }\n</code></pre>\n<p>To extract the parameters from the query string, the\n<code>require('querystring').parse</code> function can be used, or\n<code>true</code> can be passed as the second argument to <code>require('url').parse</code>.</p>\n<pre><code class=\"language-console\">$ node\n> require('url').parse('/status?name=ryan', true)\nUrl {\n  protocol: null,\n  slashes: null,\n  auth: null,\n  host: null,\n  port: null,\n  hostname: null,\n  hash: null,\n  search: '?name=ryan',\n  query: { name: 'ryan' },\n  pathname: '/status',\n  path: '/status?name=ryan',\n  href: '/status?name=ryan' }\n</code></pre>"
                }
              ],
              "methods": [
                {
                  "textRaw": "`request.destroy([error])`",
                  "type": "method",
                  "name": "destroy",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`error` {Error}",
                          "name": "error",
                          "type": "Error"
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Calls <code>destroy()</code> on the <a href=\"http2.html#http2_class_http2stream\"><code>Http2Stream</code></a> that received\nthe <a href=\"http2.html#http2_class_http2_http2serverrequest\"><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)`",
                  "type": "method",
                  "name": "setTimeout",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "return": {
                        "textRaw": "Returns: {http2.Http2ServerRequest}",
                        "name": "return",
                        "type": "http2.Http2ServerRequest"
                      },
                      "params": [
                        {
                          "textRaw": "`msecs` {number}",
                          "name": "msecs",
                          "type": "number"
                        },
                        {
                          "textRaw": "`callback` {Function}",
                          "name": "callback",
                          "type": "Function"
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Sets the <a href=\"http2.html#http2_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=\"http2.html#http2_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`",
              "type": "class",
              "name": "http2.Http2ServerResponse",
              "meta": {
                "added": [
                  "v8.4.0"
                ],
                "changes": []
              },
              "desc": "<ul>\n<li>Extends: <a href=\"stream.html#stream_stream\" class=\"type\">&lt;Stream&gt;</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=\"http2.html#http2_event_request\"><code>'request'</code></a> event.</p>",
              "events": [
                {
                  "textRaw": "Event: `'close'`",
                  "type": "event",
                  "name": "close",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "params": [],
                  "desc": "<p>Indicates that the underlying <a href=\"http2.html#http2_class_http2stream\"><code>Http2Stream</code></a> was terminated before\n<a href=\"http2.html#http2_response_end_data_encoding_callback\"><code>response.end()</code></a> was called or able to flush.</p>"
                },
                {
                  "textRaw": "Event: `'finish'`",
                  "type": "event",
                  "name": "finish",
                  "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)`",
                  "type": "method",
                  "name": "addTrailers",
                  "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#errors_class_typeerror\"><code>TypeError</code></a> being thrown.</p>"
                },
                {
                  "textRaw": "`response.end([data[, encoding]][, callback])`",
                  "type": "method",
                  "name": "end",
                  "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": [
                    {
                      "return": {
                        "textRaw": "Returns: {this}",
                        "name": "return",
                        "type": "this"
                      },
                      "params": [
                        {
                          "textRaw": "`data` {string|Buffer|Uint8Array}",
                          "name": "data",
                          "type": "string|Buffer|Uint8Array"
                        },
                        {
                          "textRaw": "`encoding` {string}",
                          "name": "encoding",
                          "type": "string"
                        },
                        {
                          "textRaw": "`callback` {Function}",
                          "name": "callback",
                          "type": "Function"
                        }
                      ]
                    }
                  ],
                  "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#http_response_write_chunk_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)`",
                  "type": "method",
                  "name": "getHeader",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "return": {
                        "textRaw": "Returns: {string}",
                        "name": "return",
                        "type": "string"
                      },
                      "params": [
                        {
                          "textRaw": "`name` {string}",
                          "name": "name",
                          "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()`",
                  "type": "method",
                  "name": "getHeaderNames",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "return": {
                        "textRaw": "Returns: {string[]}",
                        "name": "return",
                        "type": "string[]"
                      },
                      "params": []
                    }
                  ],
                  "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()`",
                  "type": "method",
                  "name": "getHeaders",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "return": {
                        "textRaw": "Returns: {Object}",
                        "name": "return",
                        "type": "Object"
                      },
                      "params": []
                    }
                  ],
                  "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)`",
                  "type": "method",
                  "name": "hasHeader",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "return": {
                        "textRaw": "Returns: {boolean}",
                        "name": "return",
                        "type": "boolean"
                      },
                      "params": [
                        {
                          "textRaw": "`name` {string}",
                          "name": "name",
                          "type": "string"
                        }
                      ]
                    }
                  ],
                  "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)`",
                  "type": "method",
                  "name": "removeHeader",
                  "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)`",
                  "type": "method",
                  "name": "setHeader",
                  "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');\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#errors_class_typeerror\"><code>TypeError</code></a> being thrown.</p>\n<p>When headers have been set with <a href=\"http2.html#http2_response_setheader_name_value\"><code>response.setHeader()</code></a>, they will be merged\nwith any headers passed to <a href=\"http2.html#http2_response_writehead_statuscode_statusmessage_headers\"><code>response.writeHead()</code></a>, with the headers passed\nto <a href=\"http2.html#http2_response_writehead_statuscode_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');\n  res.setHeader('X-Foo', 'bar');\n  res.writeHead(200, { 'Content-Type': 'text/plain' });\n  res.end('ok');\n});\n</code></pre>"
                },
                {
                  "textRaw": "`response.setTimeout(msecs[, callback])`",
                  "type": "method",
                  "name": "setTimeout",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "return": {
                        "textRaw": "Returns: {http2.Http2ServerResponse}",
                        "name": "return",
                        "type": "http2.Http2ServerResponse"
                      },
                      "params": [
                        {
                          "textRaw": "`msecs` {number}",
                          "name": "msecs",
                          "type": "number"
                        },
                        {
                          "textRaw": "`callback` {Function}",
                          "name": "callback",
                          "type": "Function"
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Sets the <a href=\"http2.html#http2_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=\"http2.html#http2_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])`",
                  "type": "method",
                  "name": "write",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "return": {
                        "textRaw": "Returns: {boolean}",
                        "name": "return",
                        "type": "boolean"
                      },
                      "params": [
                        {
                          "textRaw": "`chunk` {string|Buffer|Uint8Array}",
                          "name": "chunk",
                          "type": "string|Buffer|Uint8Array"
                        },
                        {
                          "textRaw": "`encoding` {string}",
                          "name": "encoding",
                          "type": "string"
                        },
                        {
                          "textRaw": "`callback` {Function}",
                          "name": "callback",
                          "type": "Function"
                        }
                      ]
                    }
                  ],
                  "desc": "<p>If this method is called and <a href=\"http2.html#http2_response_writehead_statuscode_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>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=\"http2.html#http2_response_write_chunk_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=\"http2.html#http2_response_write_chunk_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()`",
                  "type": "method",
                  "name": "writeContinue",
                  "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=\"http2.html#http2_event_checkcontinue\"><code>'checkContinue'</code></a> event on <code>Http2Server</code> and\n<code>Http2SecureServer</code>.</p>"
                },
                {
                  "textRaw": "`response.writeHead(statusCode[, statusMessage][, headers])`",
                  "type": "method",
                  "name": "writeHead",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": [
                      {
                        "version": "v11.10.0",
                        "pr-url": "https://github.com/nodejs/node/pull/25974",
                        "description": "Return `this` from `writeHead()` to allow chaining with `end()`."
                      }
                    ]
                  },
                  "signatures": [
                    {
                      "return": {
                        "textRaw": "Returns: {http2.Http2ServerResponse}",
                        "name": "return",
                        "type": "http2.Http2ServerResponse"
                      },
                      "params": [
                        {
                          "textRaw": "`statusCode` {number}",
                          "name": "statusCode",
                          "type": "number"
                        },
                        {
                          "textRaw": "`statusMessage` {string}",
                          "name": "statusMessage",
                          "type": "string"
                        },
                        {
                          "textRaw": "`headers` {Object}",
                          "name": "headers",
                          "type": "Object"
                        }
                      ]
                    }
                  ],
                  "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' });\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=\"http2.html#http2_response_end_data_encoding_callback\"><code>response.end()</code></a> is called.</p>\n<p>If <a href=\"http2.html#http2_response_write_chunk_encoding_callback\"><code>response.write()</code></a> or <a href=\"http2.html#http2_response_end_data_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=\"http2.html#http2_response_setheader_name_value\"><code>response.setHeader()</code></a>, they will be merged\nwith any headers passed to <a href=\"http2.html#http2_response_writehead_statuscode_statusmessage_headers\"><code>response.writeHead()</code></a>, with the headers passed\nto <a href=\"http2.html#http2_response_writehead_statuscode_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');\n  res.setHeader('X-Foo', 'bar');\n  res.writeHead(200, { 'Content-Type': 'text/plain' });\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#errors_class_typeerror\"><code>TypeError</code></a> being thrown.</p>"
                },
                {
                  "textRaw": "`response.createPushResponse(headers, callback)`",
                  "type": "method",
                  "name": "createPushResponse",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "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": "`stream` {ServerHttp2Stream} The newly-created `ServerHttp2Stream` object",
                              "name": "stream",
                              "type": "ServerHttp2Stream",
                              "desc": "The newly-created `ServerHttp2Stream` object"
                            }
                          ]
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Call <a href=\"http2.html#http2_http2stream_pushstream_headers_options_callback\"><code>http2stream.pushStream()</code></a> with the given headers, and wrap the\ngiven <a href=\"http2.html#http2_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>"
                }
              ],
              "properties": [
                {
                  "textRaw": "`connection` {net.Socket|tls.TLSSocket}",
                  "type": "net.Socket|tls.TLSSocket",
                  "name": "connection",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>See <a href=\"http2.html#http2_response_socket\"><code>response.socket</code></a>.</p>"
                },
                {
                  "textRaw": "`finished` {boolean}",
                  "type": "boolean",
                  "name": "finished",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "deprecated": [
                      "v12.16.0"
                    ],
                    "changes": []
                  },
                  "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=\"http2.html#http2_response_end_data_encoding_callback\"><code>response.end()</code></a> executes, the value will be <code>true</code>.</p>"
                },
                {
                  "textRaw": "`headersSent` {boolean}",
                  "type": "boolean",
                  "name": "headersSent",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>True if headers were sent, false otherwise (read-only).</p>"
                },
                {
                  "textRaw": "`sendDate` {boolean}",
                  "type": "boolean",
                  "name": "sendDate",
                  "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": "`socket` {net.Socket|tls.TLSSocket}",
                  "type": "net.Socket|tls.TLSSocket",
                  "name": "socket",
                  "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=\"http2.html#http2_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-js\">const http2 = require('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": "`statusCode` {number}",
                  "type": "number",
                  "name": "statusCode",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>When using implicit headers (not calling <a href=\"http2.html#http2_response_writehead_statuscode_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": "`statusMessage` {string}",
                  "type": "string",
                  "name": "statusMessage",
                  "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": "`stream` {Http2Stream}",
                  "type": "Http2Stream",
                  "name": "stream",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The <a href=\"http2.html#http2_class_http2stream\"><code>Http2Stream</code></a> object backing the response.</p>"
                },
                {
                  "textRaw": "`writableEnded` {boolean}",
                  "type": "boolean",
                  "name": "writableEnded",
                  "meta": {
                    "added": [
                      "v12.9.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>Is <code>true</code> after <a href=\"http2.html#http2_response_end_data_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#stream_writable_writablefinished\"><code>writable.writableFinished</code></a> instead.</p>"
                }
              ]
            }
          ],
          "type": "module",
          "displayName": "Compatibility API"
        },
        {
          "textRaw": "Collecting HTTP/2 performance metrics",
          "name": "collecting_http/2_performance_metrics",
          "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-js\">const { PerformanceObserver } = require('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/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;number&gt;</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/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;number&gt;</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/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;number&gt;</a> The identifier of the associated <code>Http2Stream</code></li>\n<li><code>timeToFirstByte</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;number&gt;</a> The number of milliseconds elapsed between the\n<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/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;number&gt;</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/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;number&gt;</a> The number of milliseconds elapsed between the\n<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/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;number&gt;</a> The number of bytes received for this <code>Http2Session</code>.</li>\n<li><code>bytesWritten</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;number&gt;</a> The number of bytes sent for this <code>Http2Session</code>.</li>\n<li><code>framesReceived</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;number&gt;</a> The number of HTTP/2 frames received by the\n<code>Http2Session</code>.</li>\n<li><code>framesSent</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;number&gt;</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/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;number&gt;</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/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;number&gt;</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/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;number&gt;</a> The average duration (in milliseconds) for\nall <code>Http2Stream</code> instances.</li>\n<li><code>streamCount</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;number&gt;</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/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string&gt;</a> Either <code>'server'</code> or <code>'client'</code> to identify the type of\n<code>Http2Session</code>.</li>\n</ul>",
          "type": "module",
          "displayName": "Collecting HTTP/2 performance metrics"
        }
      ],
      "type": "module",
      "displayName": "HTTP/2"
    },
    {
      "textRaw": "HTTPS",
      "name": "https",
      "introduced_in": "v0.10.0",
      "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>",
      "classes": [
        {
          "textRaw": "Class: `https.Agent`",
          "type": "class",
          "name": "https.Agent",
          "meta": {
            "added": [
              "v0.4.5"
            ],
            "changes": [
              {
                "version": "v2.5.0",
                "pr-url": "https://github.com/nodejs/node/pull/2228",
                "description": "parameter `maxCachedSessions` added to `options` for TLS sessions reuse."
              },
              {
                "version": "v5.3.0",
                "pr-url": "https://github.com/nodejs/node/pull/4252",
                "description": "support `0` `maxCachedSessions` to disable TLS session caching."
              }
            ]
          },
          "desc": "<p>An <a href=\"https.html#https_class_https_agent\"><code>Agent</code></a> object for HTTPS similar to <a href=\"http.html#http_class_http_agent\"><code>http.Agent</code></a>. See\n<a href=\"https.html#https_https_request_options_callback\"><code>https.request()</code></a> for more information.</p>",
          "signatures": [
            {
              "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][sni wiki] 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][sni wiki] to be sent to the server. Use empty string `''` to disable sending the extension."
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "textRaw": "Class: `https.Server`",
          "type": "class",
          "name": "https.Server",
          "meta": {
            "added": [
              "v0.3.4"
            ],
            "changes": []
          },
          "desc": "<ul>\n<li>Extends: <a href=\"tls.html#tls_class_tls_server\" class=\"type\">&lt;tls.Server&gt;</a></li>\n</ul>\n<p>See <a href=\"http.html#http_class_http_server\"><code>http.Server</code></a> for more information.</p>",
          "methods": [
            {
              "textRaw": "`server.close([callback])`",
              "type": "method",
              "name": "close",
              "meta": {
                "added": [
                  "v0.1.90"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {https.Server}",
                    "name": "return",
                    "type": "https.Server"
                  },
                  "params": [
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function"
                    }
                  ]
                }
              ],
              "desc": "<p>See <a href=\"http.html#http_server_close_callback\"><code>server.close()</code></a> from the HTTP module for details.</p>"
            },
            {
              "textRaw": "`server.listen()`",
              "type": "method",
              "name": "listen",
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Starts the HTTPS server listening for encrypted connections.\nThis method is identical to <a href=\"net.html#net_server_listen\"><code>server.listen()</code></a> from <a href=\"net.html#net_class_net_server\"><code>net.Server</code></a>.</p>"
            },
            {
              "textRaw": "`server.setTimeout([msecs][, callback])`",
              "type": "method",
              "name": "setTimeout",
              "meta": {
                "added": [
                  "v0.11.2"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {https.Server}",
                    "name": "return",
                    "type": "https.Server"
                  },
                  "params": [
                    {
                      "textRaw": "`msecs` {number} **Default:** `120000` (2 minutes)",
                      "name": "msecs",
                      "type": "number",
                      "default": "`120000` (2 minutes)"
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function"
                    }
                  ]
                }
              ],
              "desc": "<p>See <a href=\"http.html#http_server_settimeout_msecs_callback\"><code>http.Server#setTimeout()</code></a>.</p>"
            }
          ],
          "properties": [
            {
              "textRaw": "`headersTimeout` {number} **Default:** `60000`",
              "type": "number",
              "name": "headersTimeout",
              "meta": {
                "added": [
                  "v11.3.0"
                ],
                "changes": []
              },
              "default": "`60000`",
              "desc": "<p>See <a href=\"http.html#http_server_headerstimeout\"><code>http.Server#headersTimeout</code></a>.</p>"
            },
            {
              "textRaw": "`maxHeadersCount` {number} **Default:** `2000`",
              "type": "number",
              "name": "maxHeadersCount",
              "default": "`2000`",
              "desc": "<p>See <a href=\"http.html#http_server_maxheaderscount\"><code>http.Server#maxHeadersCount</code></a>.</p>"
            },
            {
              "textRaw": "`timeout` {number} **Default:** `120000` (2 minutes)",
              "type": "number",
              "name": "timeout",
              "meta": {
                "added": [
                  "v0.11.2"
                ],
                "changes": []
              },
              "default": "`120000` (2 minutes)",
              "desc": "<p>See <a href=\"http.html#http_server_timeout\"><code>http.Server#timeout</code></a>.</p>"
            },
            {
              "textRaw": "`keepAliveTimeout` {number} **Default:** `5000` (5 seconds)",
              "type": "number",
              "name": "keepAliveTimeout",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "changes": []
              },
              "default": "`5000` (5 seconds)",
              "desc": "<p>See <a href=\"http.html#http_server_keepalivetimeout\"><code>http.Server#keepAliveTimeout</code></a>.</p>"
            }
          ]
        }
      ],
      "methods": [
        {
          "textRaw": "`https.createServer([options][, requestListener])`",
          "type": "method",
          "name": "createServer",
          "meta": {
            "added": [
              "v0.3.4"
            ],
            "changes": []
          },
          "signatures": [
            {
              "return": {
                "textRaw": "Returns: {https.Server}",
                "name": "return",
                "type": "https.Server"
              },
              "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()`][]."
                },
                {
                  "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."
                }
              ]
            }
          ],
          "desc": "<pre><code class=\"language-js\">// curl -k https://localhost:8000/\nconst https = require('https');\nconst fs = require('fs');\n\nconst options = {\n  key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'),\n  cert: fs.readFileSync('test/fixtures/keys/agent2-cert.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-js\">const https = require('https');\nconst fs = require('fs');\n\nconst options = {\n  pfx: fs.readFileSync('test/fixtures/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>"
        },
        {
          "textRaw": "`https.get(options[, callback])`",
          "type": "method",
          "name": "get",
          "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` always set to `GET`.",
                  "name": "options",
                  "type": "Object | string | URL",
                  "desc": "Accepts the same `options` as [`https.request()`][], with the `method` always set to `GET`."
                },
                {
                  "textRaw": "`callback` {Function}",
                  "name": "callback",
                  "type": "Function"
                }
              ]
            }
          ],
          "desc": "<p>Like <a href=\"http.html#http_http_get_options_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#url_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#url_constructor_new_url_input_base\"><code>new URL()</code></a>. If it is a <a href=\"url.html#url_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-js\">const https = require('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.get(url[, options][, callback])`",
          "type": "method",
          "name": "get",
          "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` always set to `GET`.",
                  "name": "options",
                  "type": "Object | string | URL",
                  "desc": "Accepts the same `options` as [`https.request()`][], with the `method` always set to `GET`."
                },
                {
                  "textRaw": "`callback` {Function}",
                  "name": "callback",
                  "type": "Function"
                }
              ]
            }
          ],
          "desc": "<p>Like <a href=\"http.html#http_http_get_options_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#url_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#url_constructor_new_url_input_base\"><code>new URL()</code></a>. If it is a <a href=\"url.html#url_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-js\">const https = require('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])`",
          "type": "method",
          "name": "request",
          "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": "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`"
                    }
                  ]
                },
                {
                  "textRaw": "`callback` {Function}",
                  "name": "callback",
                  "type": "Function"
                }
              ]
            }
          ],
          "desc": "<p>Makes a request to a secure web server.</p>\n<p>The following additional <code>options</code> from <a href=\"tls.html#tls_tls_connect_options_callback\"><code>tls.connect()</code></a> are also accepted:\n<code>ca</code>, <code>cert</code>, <code>ciphers</code>, <code>clientCertEngine</code>, <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>.</p>\n<p><code>options</code> can be an object, a string, or a <a href=\"url.html#url_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#url_constructor_new_url_input_base\"><code>new URL()</code></a>. If it is a <a href=\"url.html#url_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-js\">const https = require('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#tls_tls_connect_options_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('test/fixtures/keys/agent2-key.pem'),\n  cert: fs.readFileSync('test/fixtures/keys/agent2-cert.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=\"https.html#https_class_https_agent\"><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('test/fixtures/keys/agent2-key.pem'),\n  cert: fs.readFileSync('test/fixtures/keys/agent2-cert.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#url_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-js\">const tls = require('tls');\nconst https = require('https');\nconst crypto = require('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-sha25 pinning\n    const pubkey256 = 'pL1+qb9HTMRZJmuC/bB/ZI9d302BYrrqiVuRyW+DGrU=';\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 = '25:FE:39:32:D9:63:8C:8A:FC:A1:9A:29:87:' +\n      'D8:3E:4C:1D:98:DB:71:E4:1A:48:03:98:EA:22:6A:BD:8B:93:16';\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  // Print the HPKP values\n  console.log('headers:', res.headers['public-key-pins']);\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: 25:FE:39:32:D9:63:8C:8A:FC:A1:9A:29:87:D8:3E:4C:1D:98:DB:71:E4:1A:48:03:98:EA:22:6A:BD:8B:93:16\n  Public key ping-sha256: pL1+qb9HTMRZJmuC/bB/ZI9d302BYrrqiVuRyW+DGrU=\nSubject Common Name: DigiCert SHA2 Extended Validation Server CA\n  Certificate SHA256 fingerprint: 40:3E:06:2A:26:53:05:91:13:28:5B:AF:80:A0:D4:AE:42:2C:84:8C:9F:78:FA:D0:1F:C9:4B:C5:B8:7F:EF:1A\n  Public key ping-sha256: RRM1dGqnDFsCJXBTHky16vi1obOlCgFFn/yOhI/y+ho=\nSubject Common Name: DigiCert High Assurance EV Root CA\n  Certificate SHA256 fingerprint: 74:31:E5:F4:C3:C1:CE:46:90:77:4F:0B:61:E0:54:40:88:3B:A9:A0:1E:D0:0B:A6:AB:D7:80:6E:D3:B1:18:CF\n  Public key ping-sha256: WoiWRyIOVNa9ihaBciRSC7XHjliYS9VwUGOIud4PB18=\nAll OK. Server matched our pinned cert or public key\nstatusCode: 200\nheaders: max-age=0; pin-sha256=\"WoiWRyIOVNa9ihaBciRSC7XHjliYS9VwUGOIud4PB18=\"; pin-sha256=\"RRM1dGqnDFsCJXBTHky16vi1obOlCgFFn/yOhI/y+ho=\"; pin-sha256=\"k2v657xBsOVe1PQRwOsHsw3bsGT2VzIqz5K+59sNQws=\"; pin-sha256=\"K87oWBWM9UZfyddvDfoxL+8lpNyoUB2ptGtn0fv6G2Q=\"; pin-sha256=\"IQBnNBEiFuhj+8x6X8XLgh01V9Ic5/V3IRQLNFFc7v4=\"; pin-sha256=\"iie1VXtL7HzAMF+/PVPR9xzT80kQxdZeJ+zduCB3uj0=\"; pin-sha256=\"LvRiGEjRqfzurezaWuj8Wie2gyHMrW5Q06LspMnox7A=\"; includeSubDomains\n</code></pre>"
        },
        {
          "textRaw": "`https.request(url[, options][, callback])`",
          "type": "method",
          "name": "request",
          "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": "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`"
                    }
                  ]
                },
                {
                  "textRaw": "`callback` {Function}",
                  "name": "callback",
                  "type": "Function"
                }
              ]
            }
          ],
          "desc": "<p>Makes a request to a secure web server.</p>\n<p>The following additional <code>options</code> from <a href=\"tls.html#tls_tls_connect_options_callback\"><code>tls.connect()</code></a> are also accepted:\n<code>ca</code>, <code>cert</code>, <code>ciphers</code>, <code>clientCertEngine</code>, <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>.</p>\n<p><code>options</code> can be an object, a string, or a <a href=\"url.html#url_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#url_constructor_new_url_input_base\"><code>new URL()</code></a>. If it is a <a href=\"url.html#url_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-js\">const https = require('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#tls_tls_connect_options_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('test/fixtures/keys/agent2-key.pem'),\n  cert: fs.readFileSync('test/fixtures/keys/agent2-cert.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=\"https.html#https_class_https_agent\"><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('test/fixtures/keys/agent2-key.pem'),\n  cert: fs.readFileSync('test/fixtures/keys/agent2-cert.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#url_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-js\">const tls = require('tls');\nconst https = require('https');\nconst crypto = require('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-sha25 pinning\n    const pubkey256 = 'pL1+qb9HTMRZJmuC/bB/ZI9d302BYrrqiVuRyW+DGrU=';\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 = '25:FE:39:32:D9:63:8C:8A:FC:A1:9A:29:87:' +\n      'D8:3E:4C:1D:98:DB:71:E4:1A:48:03:98:EA:22:6A:BD:8B:93:16';\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  // Print the HPKP values\n  console.log('headers:', res.headers['public-key-pins']);\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: 25:FE:39:32:D9:63:8C:8A:FC:A1:9A:29:87:D8:3E:4C:1D:98:DB:71:E4:1A:48:03:98:EA:22:6A:BD:8B:93:16\n  Public key ping-sha256: pL1+qb9HTMRZJmuC/bB/ZI9d302BYrrqiVuRyW+DGrU=\nSubject Common Name: DigiCert SHA2 Extended Validation Server CA\n  Certificate SHA256 fingerprint: 40:3E:06:2A:26:53:05:91:13:28:5B:AF:80:A0:D4:AE:42:2C:84:8C:9F:78:FA:D0:1F:C9:4B:C5:B8:7F:EF:1A\n  Public key ping-sha256: RRM1dGqnDFsCJXBTHky16vi1obOlCgFFn/yOhI/y+ho=\nSubject Common Name: DigiCert High Assurance EV Root CA\n  Certificate SHA256 fingerprint: 74:31:E5:F4:C3:C1:CE:46:90:77:4F:0B:61:E0:54:40:88:3B:A9:A0:1E:D0:0B:A6:AB:D7:80:6E:D3:B1:18:CF\n  Public key ping-sha256: WoiWRyIOVNa9ihaBciRSC7XHjliYS9VwUGOIud4PB18=\nAll OK. Server matched our pinned cert or public key\nstatusCode: 200\nheaders: max-age=0; pin-sha256=\"WoiWRyIOVNa9ihaBciRSC7XHjliYS9VwUGOIud4PB18=\"; pin-sha256=\"RRM1dGqnDFsCJXBTHky16vi1obOlCgFFn/yOhI/y+ho=\"; pin-sha256=\"k2v657xBsOVe1PQRwOsHsw3bsGT2VzIqz5K+59sNQws=\"; pin-sha256=\"K87oWBWM9UZfyddvDfoxL+8lpNyoUB2ptGtn0fv6G2Q=\"; pin-sha256=\"IQBnNBEiFuhj+8x6X8XLgh01V9Ic5/V3IRQLNFFc7v4=\"; pin-sha256=\"iie1VXtL7HzAMF+/PVPR9xzT80kQxdZeJ+zduCB3uj0=\"; pin-sha256=\"LvRiGEjRqfzurezaWuj8Wie2gyHMrW5Q06LspMnox7A=\"; includeSubDomains\n</code></pre>"
        }
      ],
      "properties": [
        {
          "textRaw": "`https.globalAgent`",
          "name": "globalAgent",
          "meta": {
            "added": [
              "v0.5.9"
            ],
            "changes": []
          },
          "desc": "<p>Global instance of <a href=\"https.html#https_class_https_agent\"><code>https.Agent</code></a> for all HTTPS client requests.</p>"
        }
      ],
      "type": "module",
      "displayName": "HTTPS"
    },
    {
      "textRaw": "Inspector",
      "name": "inspector",
      "introduced_in": "v8.0.0",
      "stability": 1,
      "stabilityText": "Experimental",
      "desc": "<p>The <code>inspector</code> module provides an API for interacting with the V8 inspector.</p>\n<p>It can be accessed using:</p>\n<pre><code class=\"language-js\">const inspector = require('inspector');\n</code></pre>",
      "methods": [
        {
          "textRaw": "`inspector.close()`",
          "type": "method",
          "name": "close",
          "signatures": [
            {
              "params": []
            }
          ],
          "desc": "<p>Deactivate the inspector. Blocks until there are no active connections.</p>"
        },
        {
          "textRaw": "`inspector.open([port[, host[, wait]]])`",
          "type": "method",
          "name": "open",
          "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."
                },
                {
                  "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."
                },
                {
                  "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."
                }
              ]
            }
          ],
          "desc": "<p>Activate inspector on host and port. Equivalent to <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#inspector_security\">security warning</a> regarding the <code>host</code>\nparameter usage.</p>"
        },
        {
          "textRaw": "`inspector.url()`",
          "type": "method",
          "name": "url",
          "signatures": [
            {
              "return": {
                "textRaw": "Returns: {string|undefined}",
                "name": "return",
                "type": "string|undefined"
              },
              "params": []
            }
          ],
          "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/en/docs/inspector\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/en/docs/inspector\nws://localhost:3000/51cf8d0e-3c36-4c59-8efd-54519839e56a\n\n$ node -p 'inspector.url()'\nundefined\n</code></pre>"
        },
        {
          "textRaw": "`inspector.waitForDebugger()`",
          "type": "method",
          "name": "waitForDebugger",
          "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": "`console` {Object} An object to send messages to the remote inspector console.",
          "type": "Object",
          "name": "console",
          "desc": "<pre><code class=\"language-js\">require('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."
        }
      ],
      "classes": [
        {
          "textRaw": "Class: `inspector.Session`",
          "type": "class",
          "name": "inspector.Session",
          "desc": "<ul>\n<li>Extends: <a href=\"events.html#events_class_eventemitter\" class=\"type\">&lt;EventEmitter&gt;</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>",
          "events": [
            {
              "textRaw": "Event: `'inspectorNotification'`",
              "type": "event",
              "name": "inspectorNotification",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "changes": []
              },
              "params": [
                {
                  "textRaw": "{Object} The notification message object",
                  "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<p>It is also possible to subscribe only to notifications with specific method:</p>"
            },
            {
              "textRaw": "Event: `<inspector-protocol-method>`;",
              "type": "event",
              "name": "<inspector-protocol-method>`;",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "changes": []
              },
              "params": [
                {
                  "textRaw": "{Object} The notification message object",
                  "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>"
            }
          ],
          "methods": [
            {
              "textRaw": "`session.connect()`",
              "type": "method",
              "name": "connect",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Connects a session to the inspector back-end.</p>"
            },
            {
              "textRaw": "`session.connectToMainThread()`",
              "type": "method",
              "name": "connectToMainThread",
              "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()`",
              "type": "method",
              "name": "disconnect",
              "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=\"inspector.html#inspector_session_connect\"><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])`",
              "type": "method",
              "name": "post",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`method` {string}",
                      "name": "method",
                      "type": "string"
                    },
                    {
                      "textRaw": "`params` {Object}",
                      "name": "params",
                      "type": "Object"
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function"
                    }
                  ]
                }
              ],
              "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<h2>Example usage</h2>\n<p>Apart from the debugger, various V8 Profilers are available through the DevTools\nprotocol.</p>"
            }
          ],
          "modules": [
            {
              "textRaw": "CPU profiler",
              "name": "cpu_profiler",
              "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('inspector');\nconst fs = require('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>",
              "type": "module",
              "displayName": "CPU profiler"
            },
            {
              "textRaw": "Heap profiler",
              "name": "heap_profiler",
              "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('inspector');\nconst fs = require('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>",
              "type": "module",
              "displayName": "Heap profiler"
            }
          ],
          "signatures": [
            {
              "params": [],
              "desc": "<p>Create a new instance of the <code>inspector.Session</code> class. The inspector session\nneeds to be connected through <a href=\"inspector.html#inspector_session_connect\"><code>session.connect()</code></a> before the messages\ncan be dispatched to the inspector backend.</p>"
            }
          ]
        }
      ],
      "type": "module",
      "displayName": "Inspector"
    },
    {
      "textRaw": "Modules",
      "name": "module",
      "introduced_in": "v0.10.0",
      "stability": 2,
      "stabilityText": "Stable",
      "desc": "<p>In the Node.js module system, 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=\"modules.html#modules_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>Below, <code>bar.js</code> makes use of the <code>square</code> module, which exports a 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 module system is implemented in the <code>require('module')</code> module.</p>",
      "miscs": [
        {
          "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>Because <code>module</code> provides a <code>filename</code> property (normally equivalent to\n<code>__filename</code>), the entry point of the current application can be obtained\nby checking <code>require.main.filename</code>.</p>"
        },
        {
          "textRaw": "Addenda: Package manager tips",
          "name": "Addenda: 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>Below 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>Since Node.js looks up the <code>realpath</code> of any modules it loads (that is,\nresolves symlinks), and then looks for their dependencies in the <code>node_modules</code>\nfolders as described <a href=\"modules.html#modules_loading_from_node_modules_folders\">here</a>, this\nsituation is very simple to resolve 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 be the filesystem root\n3. If X begins with './' or '/' or '../'\n   a. LOAD_AS_FILE(Y + X)\n   b. LOAD_AS_DIRECTORY(Y + X)\n   c. THROW \"not found\"\n4. LOAD_SELF_REFERENCE(X, dirname(Y))\n5. LOAD_NODE_MODULES(X, dirname(Y))\n6. THROW \"not found\"\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, load X.js as JavaScript text. STOP\n3. If X.json is a file, parse 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, load X/index.js as JavaScript text. 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(DIR, X)\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 = [GLOBAL_FOLDERS]\n4. while I >= 0,\n   a. if PARTS[I] = \"node_modules\" CONTINUE\n   b. DIR = path join(PARTS[0 .. I] + \"node_modules\")\n   c. DIRS = DIRS + DIR\n   d. let I = I - 1\n5. return DIRS\n\nLOAD_SELF_REFERENCE(X, START)\n1. Find the closest package scope to START.\n2. If no scope was found, return.\n3. If the `package.json` has no \"exports\", return.\n4. If the name in `package.json` is a prefix of X, then\n   a. Load the remainder of X relative to this package as if it was\n      loaded via `LOAD_NODE_MODULES` with a name in `package.json`.\n\nLOAD_PACKAGE_EXPORTS(DIR, X)\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 \"exports\" is an object with some keys starting with \".\" and some keys\n  not starting with \".\", throw \"invalid config\".\n6. If \"exports\" is a string, or object with no keys starting with \".\", treat\n  it as having that value as its \".\" object property.\n7. If subpath is \".\" and \"exports\" does not have a \".\" entry, return.\n8. Find the longest key in \"exports\" that the subpath starts with.\n9. If no such key can be found, throw \"not found\".\n10. let RESOLVED =\n    fileURLToPath(PACKAGE_EXPORTS_TARGET_RESOLVE(pathToFileURL(DIR/name),\n    exports[key], subpath.slice(key.length), [\"node\", \"require\"])), as defined\n    in the ESM resolver.\n11. If key ends with \"/\":\n    a. LOAD_AS_FILE(RESOLVED)\n    b. LOAD_AS_DIRECTORY(RESOLVED)\n12. Otherwise\n   a. If RESOLVED is a file, load it as its file extension format. STOP\n13. Throw \"not found\"\n</code></pre>"
        },
        {
          "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": "Core modules",
          "name": "Core modules",
          "type": "misc",
          "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 core modules are defined within the Node.js source and are located in the\n<code>lib/</code> folder.</p>\n<p>Core 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>"
        },
        {
          "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>.</p>\n<p><code>.js</code> files are interpreted as JavaScript text files, and <code>.json</code> files are\nparsed as JSON text files. <code>.node</code> files are interpreted as compiled addon\nmodules loaded with <code>process.dlopen()</code>.</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 an <a href=\"errors.html#errors_class_error\"><code>Error</code></a> with its\n<code>code</code> property set to <code>'MODULE_NOT_FOUND'</code>.</p>"
        },
        {
          "textRaw": "Folders as modules",
          "name": "Folders as modules",
          "type": "misc",
          "desc": "<p>It is convenient to organize programs and libraries into self-contained\ndirectories, and then provide a single entry point to those directories.\nThere 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 <code>package.json</code> file in the root of the folder,\nwhich specifies a <code>main</code> module. An example <code>package.json</code> 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>This is the extent of the awareness of <code>package.json</code> files within Node.js.</p>\n<p>If there is no <code>package.json</code> file present in the directory, or if the\n<code>'main'</code> 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 <code>package.json</code> file in the above\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>"
        },
        {
          "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=\"modules.html#modules_core_modules\">core</a> module, and does not begin with <code>'/'</code>, <code>'../'</code>, or\n<code>'./'</code>, then Node.js starts at the parent 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=\"modules.html#modules_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>\n<p>It helps to provide some global-looking variables that are actually specific\nto the module, such as:</p>\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": "Addenda: The `.mjs` extension",
          "name": "addenda:_the_`.mjs`_extension",
          "desc": "<p>It is not possible to <code>require()</code> files that have the <code>.mjs</code> extension.\nAttempting to do so will throw <a href=\"errors.html#errors_err_require_esm\">an error</a>. The <code>.mjs</code> extension is\nreserved for <a href=\"esm.html\">ECMAScript Modules</a> which cannot be loaded via <code>require()</code>.\nSee <a href=\"esm.html\">ECMAScript Modules</a> for more details.</p>",
          "type": "module",
          "displayName": "Addenda: The `.mjs` extension"
        },
        {
          "textRaw": "The module scope",
          "name": "the_module_scope",
          "vars": [
            {
              "textRaw": "`__dirname`",
              "name": "`__dirname`",
              "meta": {
                "added": [
                  "v0.1.27"
                ],
                "changes": []
              },
              "type": "var",
              "desc": "<ul>\n<li><a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string&gt;</a></li>\n</ul>\n<p>The directory name of the current module. This is the same as the\n<a href=\"path.html#path_path_dirname_path\"><code>path.dirname()</code></a> of the <a href=\"modules.html#modules_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>"
            },
            {
              "textRaw": "`__filename`",
              "name": "`__filename`",
              "meta": {
                "added": [
                  "v0.0.1"
                ],
                "changes": []
              },
              "type": "var",
              "desc": "<ul>\n<li><a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string&gt;</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=\"modules.html#modules_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>"
            },
            {
              "textRaw": "`exports`",
              "name": "`exports`",
              "meta": {
                "added": [
                  "v0.1.12"
                ],
                "changes": []
              },
              "type": "var",
              "desc": "<ul>\n<li><a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object\" class=\"type\">&lt;Object&gt;</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=\"modules.html#modules_exports_shortcut\">exports shortcut</a> for details on when to use\n<code>exports</code> and when to use <code>module.exports</code>.</p>"
            },
            {
              "textRaw": "`module`",
              "name": "`module`",
              "meta": {
                "added": [
                  "v0.1.16"
                ],
                "changes": []
              },
              "type": "var",
              "desc": "<ul>\n<li><a href=\"modules.html#modules_the_module_object\" class=\"type\">&lt;module&gt;</a></li>\n</ul>\n<p>A reference to the current module, see the section about the\n<a href=\"modules.html#modules_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>"
            },
            {
              "textRaw": "`require(id)`",
              "type": "var",
              "name": "require",
              "meta": {
                "added": [
                  "v0.1.13"
                ],
                "changes": []
              },
              "desc": "<ul>\n<li><code>id</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string&gt;</a> module name or path</li>\n<li>Returns: <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Data_types\" class=\"type\">&lt;any&gt;</a> exported module content</li>\n</ul>\n<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=\"modules.html#modules_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('crypto');\n</code></pre>",
              "properties": [
                {
                  "textRaw": "`cache` {Object}",
                  "type": "Object",
                  "name": "cache",
                  "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\nnative modules and if a name matching a native module is added to the cache,\nno require call is\ngoing to receive the native module anymore. Use with care!</p>"
                },
                {
                  "textRaw": "`extensions` {Object}",
                  "type": "Object",
                  "name": "extensions",
                  "meta": {
                    "added": [
                      "v0.3.0"
                    ],
                    "deprecated": [
                      "v0.10.6"
                    ],
                    "changes": []
                  },
                  "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": "`main` {module}",
                  "type": "module",
                  "name": "main",
                  "meta": {
                    "added": [
                      "v0.1.17"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The <code>Module</code> object representing the entry script loaded when the Node.js\nprocess launched.\nSee <a href=\"modules.html#modules_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<!-- eslint-skip -->\n<pre><code class=\"language-js\">Module {\n  id: '.',\n  path: '/absolute/path/to',\n  exports: {},\n  parent: null,\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])`",
                  "type": "method",
                  "name": "resolve",
                  "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": [
                    {
                      "return": {
                        "textRaw": "Returns: {string}",
                        "name": "return",
                        "type": "string"
                      },
                      "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."
                            }
                          ]
                        }
                      ]
                    }
                  ],
                  "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)`",
                      "type": "method",
                      "name": "paths",
                      "meta": {
                        "added": [
                          "v8.9.0"
                        ],
                        "changes": []
                      },
                      "signatures": [
                        {
                          "return": {
                            "textRaw": "Returns: {string[]|null}",
                            "name": "return",
                            "type": "string[]|null"
                          },
                          "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."
                            }
                          ]
                        }
                      ],
                      "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>"
                    }
                  ]
                }
              ]
            }
          ],
          "type": "module",
          "displayName": "The module scope"
        },
        {
          "textRaw": "The `Module` object",
          "name": "the_`module`_object",
          "meta": {
            "added": [
              "v0.3.7"
            ],
            "changes": []
          },
          "desc": "<ul>\n<li><a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object\" class=\"type\">&lt;Object&gt;</a></li>\n</ul>\n<p>Provides general utility methods when interacting with instances of\n<code>Module</code>, the <code>module</code> variable often seen in file modules. Accessed\nvia <code>require('module')</code>.</p>",
          "properties": [
            {
              "textRaw": "`builtinModules` {string[]}",
              "type": "string[]",
              "name": "builtinModules",
              "meta": {
                "added": [
                  "v9.3.0",
                  "v8.10.0",
                  "v6.13.0"
                ],
                "changes": []
              },
              "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#modules_the_module_wrapper\">module wrapper</a>. To access it, require the <code>Module</code> module:</p>\n<pre><code class=\"language-js\">const builtin = require('module').builtinModules;\n</code></pre>"
            }
          ],
          "methods": [
            {
              "textRaw": "`module.createRequire(filename)`",
              "type": "method",
              "name": "createRequire",
              "meta": {
                "added": [
                  "v12.2.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {require} Require function",
                    "name": "return",
                    "type": "require",
                    "desc": "Require function"
                  },
                  "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."
                    }
                  ]
                }
              ],
              "desc": "<pre><code class=\"language-js\">import { createRequire } from '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.createRequireFromPath(filename)`",
              "type": "method",
              "name": "createRequireFromPath",
              "meta": {
                "added": [
                  "v10.12.0"
                ],
                "deprecated": [
                  "v12.2.0"
                ],
                "changes": []
              },
              "stability": 0,
              "stabilityText": "Deprecated: Please use [`createRequire()`][] instead.",
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {require} Require function",
                    "name": "return",
                    "type": "require",
                    "desc": "Require function"
                  },
                  "params": [
                    {
                      "textRaw": "`filename` {string} Filename to be used to construct the relative require function.",
                      "name": "filename",
                      "type": "string",
                      "desc": "Filename to be used to construct the relative require function."
                    }
                  ]
                }
              ],
              "desc": "<pre><code class=\"language-js\">const { createRequireFromPath } = require('module');\nconst requireUtil = createRequireFromPath('../src/utils/');\n\n// Require `../src/utils/some-tool`\nrequireUtil('./some-tool');\n</code></pre>"
            },
            {
              "textRaw": "`module.syncBuiltinESMExports()`",
              "type": "method",
              "name": "syncBuiltinESMExports",
              "meta": {
                "added": [
                  "v12.12.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>The <code>module.syncBuiltinESMExports()</code> method updates all the live bindings for\nbuiltin ES Modules to match the properties of the CommonJS exports. It does\nnot add or remove exported names from the ES Modules.</p>\n<pre><code class=\"language-js\">const fs = require('fs');\nconst { syncBuiltinESMExports } = require('module');\n\nfs.readFile = null;\n\ndelete fs.readFileSync;\n\nfs.newAPI = function newAPI() {\n  // ...\n};\n\nsyncBuiltinESMExports();\n\nimport('fs').then((esmFS) => {\n  assert.strictEqual(esmFS.readFile, null);\n  assert.strictEqual('readFileSync' in fs, true);\n  assert.strictEqual(esmFS.newAPI, undefined);\n});\n</code></pre>"
            }
          ],
          "type": "module",
          "displayName": "The `Module` object"
        },
        {
          "textRaw": "Source map v3 support",
          "name": "source_map_v3_support",
          "meta": {
            "added": [
              "v12.17.0"
            ],
            "changes": []
          },
          "stability": 1,
          "stabilityText": "Experimental",
          "desc": "<p>Helpers for interacting with the source map cache. This cache is\npopulated when source map parsing is enabled and\n<a href=\"https://sourcemaps.info/spec.html#h.lmz475t4mvbx\">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#cli_enable_source_maps\"><code>--enable-source-maps</code></a>, or with code coverage enabled by setting\n<a href=\"cli.html#cli_node_v8_coverage_dir\"><code>NODE_V8_COVERAGE=dir</code></a>.</p>\n<pre><code class=\"language-js\">const { findSourceMap, SourceMap } = require('module');\n</code></pre>",
          "methods": [
            {
              "textRaw": "`module.findSourceMap(path[, error])`",
              "type": "method",
              "name": "findSourceMap",
              "meta": {
                "added": [
                  "v12.17.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {module.SourceMap}",
                    "name": "return",
                    "type": "module.SourceMap"
                  },
                  "params": [
                    {
                      "textRaw": "`path` {string}",
                      "name": "path",
                      "type": "string"
                    },
                    {
                      "textRaw": "`error` {Error}",
                      "name": "error",
                      "type": "Error"
                    }
                  ]
                }
              ],
              "desc": "<p><code>path</code> is the resolved path for the file for which a corresponding source map\nshould be fetched.</p>\n<p>The <code>error</code> instance should be passed as the second parameter to <code>findSourceMap</code>\nin exceptional flows, e.g., when an overridden\n<a href=\"https://v8.dev/docs/stack-trace-api#customizing-stack-traces\"><code>Error.prepareStackTrace(error, trace)</code></a> is invoked. Modules are not added to\nthe module cache until they are successfully loaded, in these cases source maps\nwill be associated with the <code>error</code> instance along with the <code>path</code>.</p>"
            }
          ],
          "classes": [
            {
              "textRaw": "Class: `module.SourceMap`",
              "type": "class",
              "name": "module.SourceMap",
              "meta": {
                "added": [
                  "v12.17.0"
                ],
                "changes": []
              },
              "properties": [
                {
                  "textRaw": "`payload` Returns: {Object}",
                  "type": "Object",
                  "name": "return",
                  "desc": "<p>Getter for the payload used to construct the <a href=\"modules.html#modules_class_module_sourcemap\"><code>SourceMap</code></a> instance.</p>"
                }
              ],
              "methods": [
                {
                  "textRaw": "`sourceMap.findEntry(lineNumber, columnNumber)`",
                  "type": "method",
                  "name": "findEntry",
                  "signatures": [
                    {
                      "return": {
                        "textRaw": "Returns: {Object}",
                        "name": "return",
                        "type": "Object"
                      },
                      "params": [
                        {
                          "textRaw": "`lineNumber` {number}",
                          "name": "lineNumber",
                          "type": "number"
                        },
                        {
                          "textRaw": "`columnNumber` {number}",
                          "name": "columnNumber",
                          "type": "number"
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Given a line number and column number in the generated source file, returns\nan object representing the position in the original file. The object returned\nconsists of the following keys:</p>\n<ul>\n<li>generatedLine: <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;number&gt;</a></li>\n<li>generatedColumn: <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;number&gt;</a></li>\n<li>originalSource: <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string&gt;</a></li>\n<li>originalLine: <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;number&gt;</a></li>\n<li>originalColumn: <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;number&gt;</a></li>\n</ul>"
                }
              ],
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`payload` {Object}",
                      "name": "payload",
                      "type": "Object"
                    }
                  ],
                  "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://sourcemaps.info/spec.html#h.mofvlxcwqzej\">Source map v3 format</a>:</p>\n<ul>\n<li><code>file</code>: <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string&gt;</a></li>\n<li><code>version</code>: <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;number&gt;</a></li>\n<li><code>sources</code>: <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string[]&gt;</a></li>\n<li><code>sourcesContent</code>: <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string[]&gt;</a></li>\n<li><code>names</code>: <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string[]&gt;</a></li>\n<li><code>mappings</code>: <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string&gt;</a></li>\n<li><code>sourceRoot</code>: <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string&gt;</a></li>\n</ul>"
                }
              ]
            }
          ],
          "type": "module",
          "displayName": "Source map v3 support"
        }
      ],
      "vars": [
        {
          "textRaw": "The `module` object",
          "name": "module",
          "meta": {
            "added": [
              "v0.1.16"
            ],
            "changes": []
          },
          "type": "var",
          "desc": "<ul>\n<li><a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object\" class=\"type\">&lt;Object&gt;</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": "`children` {module[]}",
              "type": "module[]",
              "name": "children",
              "meta": {
                "added": [
                  "v0.1.16"
                ],
                "changes": []
              },
              "desc": "<p>The module objects required for the first time by this one.</p>"
            },
            {
              "textRaw": "`exports` {Object}",
              "type": "Object",
              "name": "exports",
              "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('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",
                  "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<!-- eslint-disable func-name-matching -->\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>",
                  "type": "module",
                  "displayName": "`exports` shortcut"
                }
              ]
            },
            {
              "textRaw": "`filename` {string}",
              "type": "string",
              "name": "filename",
              "meta": {
                "added": [
                  "v0.1.16"
                ],
                "changes": []
              },
              "desc": "<p>The fully resolved filename of the module.</p>"
            },
            {
              "textRaw": "`id` {string}",
              "type": "string",
              "name": "id",
              "meta": {
                "added": [
                  "v0.1.16"
                ],
                "changes": []
              },
              "desc": "<p>The identifier for the module. Typically this is the fully resolved\nfilename.</p>"
            },
            {
              "textRaw": "`loaded` {boolean}",
              "type": "boolean",
              "name": "loaded",
              "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": "`parent` {module}",
              "type": "module",
              "name": "parent",
              "meta": {
                "added": [
                  "v0.1.16"
                ],
                "changes": []
              },
              "desc": "<p>The module that first required this one.</p>"
            },
            {
              "textRaw": "`path` {string}",
              "type": "string",
              "name": "path",
              "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#path_path_dirname_path\"><code>path.dirname()</code></a> of the <a href=\"modules.html#modules_module_id\"><code>module.id</code></a>.</p>"
            },
            {
              "textRaw": "`paths` {string[]}",
              "type": "string[]",
              "name": "paths",
              "meta": {
                "added": [
                  "v0.4.0"
                ],
                "changes": []
              },
              "desc": "<p>The search paths for the module.</p>"
            }
          ],
          "methods": [
            {
              "textRaw": "`module.require(id)`",
              "type": "method",
              "name": "require",
              "meta": {
                "added": [
                  "v0.5.1"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {any} exported module content",
                    "name": "return",
                    "type": "any",
                    "desc": "exported module content"
                  },
                  "params": [
                    {
                      "textRaw": "`id` {string}",
                      "name": "id",
                      "type": "string"
                    }
                  ]
                }
              ],
              "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>"
            }
          ]
        }
      ],
      "type": "module",
      "displayName": "module"
    },
    {
      "textRaw": "Net",
      "name": "net",
      "introduced_in": "v0.10.0",
      "desc": "<!--lint disable maximum-line-length-->\n<blockquote>\n<p>Stability: 2 - Stable</p>\n</blockquote>\n<p>The <code>net</code> module provides an asynchronous network API for creating stream-based\nTCP or <a href=\"net.html#net_ipc_support\">IPC</a> servers (<a href=\"net.html#net_net_createserver_options_connectionlistener\"><code>net.createServer()</code></a>) and clients\n(<a href=\"net.html#net_net_createconnection\"><code>net.createConnection()</code></a>).</p>\n<p>It can be accessed using:</p>\n<pre><code class=\"language-js\">const net = require('net');\n</code></pre>",
      "modules": [
        {
          "textRaw": "IPC support",
          "name": "ipc_support",
          "desc": "<p>The <code>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",
              "desc": "<p><a href=\"net.html#net_net_connect\"><code>net.connect()</code></a>, <a href=\"net.html#net_net_createconnection\"><code>net.createConnection()</code></a>, <a href=\"net.html#net_server_listen\"><code>server.listen()</code></a> and\n<a href=\"net.html#net_socket_connect\"><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\nfilesystem pathname. It gets truncated to an OS-dependent length of\n<code>sizeof(sockaddr_un.sun_path) - 1</code>. Typical values are 107 bytes on Linux and\n103 bytes on macOS. If a Node.js API abstraction creates the Unix domain socket,\nit will unlink the Unix domain socket as well. For example,\n<a href=\"net.html#net_net_createserver_options_connectionlistener\"><code>net.createServer()</code></a> may create a Unix domain socket and\n<a href=\"net.html#net_server_close_callback\"><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 filesystem and\nwill persist until unlinked.</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>",
              "type": "module",
              "displayName": "Identifying paths for IPC connections"
            }
          ],
          "type": "module",
          "displayName": "IPC support"
        }
      ],
      "classes": [
        {
          "textRaw": "Class: `net.Server`",
          "type": "class",
          "name": "net.Server",
          "meta": {
            "added": [
              "v0.1.90"
            ],
            "changes": []
          },
          "desc": "<ul>\n<li>Extends: <a href=\"events.html#events_class_eventemitter\" class=\"type\">&lt;EventEmitter&gt;</a></li>\n</ul>\n<p>This class is used to create a TCP or <a href=\"net.html#net_ipc_support\">IPC</a> server.</p>",
          "events": [
            {
              "textRaw": "Event: `'close'`",
              "type": "event",
              "name": "close",
              "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'`",
              "type": "event",
              "name": "connection",
              "meta": {
                "added": [
                  "v0.1.90"
                ],
                "changes": []
              },
              "params": [
                {
                  "textRaw": "{net.Socket} The connection object",
                  "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'`",
              "type": "event",
              "name": "error",
              "meta": {
                "added": [
                  "v0.1.90"
                ],
                "changes": []
              },
              "params": [
                {
                  "textRaw": "{Error}",
                  "type": "Error"
                }
              ],
              "desc": "<p>Emitted when an error occurs. Unlike <a href=\"net.html#net_class_net_socket\"><code>net.Socket</code></a>, the <a href=\"net.html#net_event_close\"><code>'close'</code></a>\nevent will <strong>not</strong> be emitted directly following this event unless\n<a href=\"net.html#net_server_close_callback\"><code>server.close()</code></a> is manually called. See the example in discussion of\n<a href=\"net.html#net_server_listen\"><code>server.listen()</code></a>.</p>"
            },
            {
              "textRaw": "Event: `'listening'`",
              "type": "event",
              "name": "listening",
              "meta": {
                "added": [
                  "v0.1.90"
                ],
                "changes": []
              },
              "params": [],
              "desc": "<p>Emitted when the server has been bound after calling <a href=\"net.html#net_server_listen\"><code>server.listen()</code></a>.</p>"
            }
          ],
          "methods": [
            {
              "textRaw": "`server.address()`",
              "type": "method",
              "name": "address",
              "meta": {
                "added": [
                  "v0.1.90"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Object|string|null}",
                    "name": "return",
                    "type": "Object|string|null"
                  },
                  "params": []
                }
              ],
              "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])`",
              "type": "method",
              "name": "close",
              "meta": {
                "added": [
                  "v0.1.90"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {net.Server}",
                    "name": "return",
                    "type": "net.Server"
                  },
                  "params": [
                    {
                      "textRaw": "`callback` {Function} Called when the server is closed.",
                      "name": "callback",
                      "type": "Function",
                      "desc": "Called when the server is closed."
                    }
                  ]
                }
              ],
              "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=\"net.html#net_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.getConnections(callback)`",
              "type": "method",
              "name": "getConnections",
              "meta": {
                "added": [
                  "v0.9.7"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {net.Server}",
                    "name": "return",
                    "type": "net.Server"
                  },
                  "params": [
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function"
                    }
                  ]
                }
              ],
              "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()`",
              "type": "method",
              "name": "listen",
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Start a server listening for connections. A <code>net.Server</code> can be a TCP or\nan <a href=\"net.html#net_ipc_support\">IPC</a> server depending on what it listens to.</p>\n<p>Possible signatures:</p>\n<ul>\n<li><a href=\"net.html#net_server_listen_handle_backlog_callback\"><code>server.listen(handle[, backlog][, callback])</code></a></li>\n<li><a href=\"net.html#net_server_listen_options_callback\"><code>server.listen(options[, callback])</code></a></li>\n<li><a href=\"net.html#net_server_listen_path_backlog_callback\"><code>server.listen(path[, backlog][, callback])</code></a>\nfor <a href=\"net.html#net_ipc_support\">IPC</a> servers</li>\n<li>\n<a href=\"net.html#net_server_listen_port_host_backlog_callback\">\n<code>server.listen([port[, host[, backlog]]][, callback])</code></a>\nfor TCP servers\n</li>\n</ul>\n<p>This function is asynchronous. When the server starts listening, the\n<a href=\"net.html#net_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=\"net.html#net_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=\"net.html#net_class_net_socket\"><code>net.Socket</code></a> are set to <code>SO_REUSEADDR</code> (see <a href=\"http://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.log('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])`",
                  "type": "method",
                  "name": "listen",
                  "meta": {
                    "added": [
                      "v0.5.10"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "return": {
                        "textRaw": "Returns: {net.Server}",
                        "name": "return",
                        "type": "net.Server"
                      },
                      "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"
                        },
                        {
                          "textRaw": "`callback` {Function}",
                          "name": "callback",
                          "type": "Function"
                        }
                      ]
                    }
                  ],
                  "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])`",
                  "type": "method",
                  "name": "listen",
                  "meta": {
                    "added": [
                      "v0.11.14"
                    ],
                    "changes": [
                      {
                        "version": "v11.4.0",
                        "pr-url": "https://github.com/nodejs/node/pull/23798",
                        "description": "The `ipv6Only` option is supported."
                      }
                    ]
                  },
                  "signatures": [
                    {
                      "return": {
                        "textRaw": "Returns: {net.Server}",
                        "name": "return",
                        "type": "net.Server"
                      },
                      "params": [
                        {
                          "textRaw": "`options` {Object} Required. Supports the following properties:",
                          "name": "options",
                          "type": "Object",
                          "desc": "Required. Supports the following properties:",
                          "options": [
                            {
                              "textRaw": "`port` {number}",
                              "name": "port",
                              "type": "number"
                            },
                            {
                              "textRaw": "`host` {string}",
                              "name": "host",
                              "type": "string"
                            },
                            {
                              "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": "`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": "`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": "`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": "`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": "`callback` {Function} functions.",
                          "name": "callback",
                          "type": "Function",
                          "desc": "functions."
                        }
                      ]
                    }
                  ],
                  "desc": "<p>If <code>port</code> is specified, it behaves the same as\n<a href=\"net.html#net_server_listen_port_host_backlog_callback\">\n<code>server.listen([port[, host[, backlog]]][, callback])</code></a>.\nOtherwise, if <code>path</code> is specified, it behaves the same as\n<a href=\"net.html#net_server_listen_path_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>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>"
                },
                {
                  "textRaw": "`server.listen(path[, backlog][, callback])`",
                  "type": "method",
                  "name": "listen",
                  "meta": {
                    "added": [
                      "v0.1.90"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "return": {
                        "textRaw": "Returns: {net.Server}",
                        "name": "return",
                        "type": "net.Server"
                      },
                      "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."
                        },
                        {
                          "textRaw": "`callback` {Function}.",
                          "name": "callback",
                          "type": "Function",
                          "desc": "."
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Start an <a href=\"net.html#net_ipc_support\">IPC</a> server listening for connections on the given <code>path</code>.</p>"
                },
                {
                  "textRaw": "`server.listen([port[, host[, backlog]]][, callback])`",
                  "type": "method",
                  "name": "listen",
                  "meta": {
                    "added": [
                      "v0.1.90"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "return": {
                        "textRaw": "Returns: {net.Server}",
                        "name": "return",
                        "type": "net.Server"
                      },
                      "params": [
                        {
                          "textRaw": "`port` {number}",
                          "name": "port",
                          "type": "number"
                        },
                        {
                          "textRaw": "`host` {string}",
                          "name": "host",
                          "type": "string"
                        },
                        {
                          "textRaw": "`backlog` {number} Common parameter of [`server.listen()`][] functions.",
                          "name": "backlog",
                          "type": "number",
                          "desc": "Common parameter of [`server.listen()`][] functions."
                        },
                        {
                          "textRaw": "`callback` {Function}.",
                          "name": "callback",
                          "type": "Function",
                          "desc": "."
                        }
                      ]
                    }
                  ],
                  "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=\"net.html#net_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()`",
              "type": "method",
              "name": "ref",
              "meta": {
                "added": [
                  "v0.9.1"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {net.Server}",
                    "name": "return",
                    "type": "net.Server"
                  },
                  "params": []
                }
              ],
              "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()`",
              "type": "method",
              "name": "unref",
              "meta": {
                "added": [
                  "v0.9.1"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {net.Server}",
                    "name": "return",
                    "type": "net.Server"
                  },
                  "params": []
                }
              ],
              "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": "`connections` {integer|null}",
              "type": "integer|null",
              "name": "connections",
              "meta": {
                "added": [
                  "v0.2.0"
                ],
                "deprecated": [
                  "v0.9.7"
                ],
                "changes": []
              },
              "stability": 0,
              "stabilityText": "Deprecated: Use [`server.getConnections()`][] instead.",
              "desc": "<p>The number of concurrent connections on the server.</p>\n<p>This becomes <code>null</code> when sending a socket to a child with\n<a href=\"child_process.html#child_process_child_process_fork_modulepath_args_options\"><code>child_process.fork()</code></a>. To poll forks and get current number of active\nconnections, use asynchronous <a href=\"net.html#net_server_getconnections_callback\"><code>server.getConnections()</code></a> instead.</p>"
            },
            {
              "textRaw": "`listening` {boolean} Indicates whether or not the server is listening for connections.",
              "type": "boolean",
              "name": "listening",
              "meta": {
                "added": [
                  "v5.7.0"
                ],
                "changes": []
              },
              "desc": "Indicates whether or not the server is listening for connections."
            },
            {
              "textRaw": "`maxConnections` {integer}",
              "type": "integer",
              "name": "maxConnections",
              "meta": {
                "added": [
                  "v0.2.0"
                ],
                "changes": []
              },
              "desc": "<p>Set this property to reject connections when the server's connection count gets\nhigh.</p>\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_process_child_process_fork_modulepath_args_options\"><code>child_process.fork()</code></a>.</p>"
            }
          ],
          "signatures": [
            {
              "return": {
                "textRaw": "Returns: {net.Server}",
                "name": "return",
                "type": "net.Server"
              },
              "params": [
                {
                  "textRaw": "`options` {Object} See [`net.createServer([options][, connectionListener])`][`net.createServer()`].",
                  "name": "options",
                  "type": "Object",
                  "desc": "See [`net.createServer([options][, connectionListener])`][`net.createServer()`]."
                },
                {
                  "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."
                }
              ],
              "desc": "<p><code>net.Server</code> is an <a href=\"events.html#events_class_eventemitter\"><code>EventEmitter</code></a> with the following events:</p>"
            }
          ]
        },
        {
          "textRaw": "Class: `net.Socket`",
          "type": "class",
          "name": "net.Socket",
          "meta": {
            "added": [
              "v0.3.4"
            ],
            "changes": []
          },
          "desc": "<ul>\n<li>Extends: <a href=\"stream.html#stream_class_stream_duplex\" class=\"type\">&lt;stream.Duplex&gt;</a></li>\n</ul>\n<p>This class is an abstraction of a TCP socket or a streaming <a href=\"net.html#net_ipc_support\">IPC</a> endpoint\n(uses named pipes on Windows, and Unix domain sockets otherwise). It is also\nan <a href=\"events.html#events_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=\"net.html#net_net_createconnection\"><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=\"net.html#net_event_connection\"><code>'connection'</code></a> event emitted on a <a href=\"net.html#net_class_net_server\"><code>net.Server</code></a>, so the user can use\nit to interact with the client.</p>",
          "events": [
            {
              "textRaw": "Event: `'close'`",
              "type": "event",
              "name": "close",
              "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'`",
              "type": "event",
              "name": "connect",
              "meta": {
                "added": [
                  "v0.1.90"
                ],
                "changes": []
              },
              "params": [],
              "desc": "<p>Emitted when a socket connection is successfully established.\nSee <a href=\"net.html#net_net_createconnection\"><code>net.createConnection()</code></a>.</p>"
            },
            {
              "textRaw": "Event: `'data'`",
              "type": "event",
              "name": "data",
              "meta": {
                "added": [
                  "v0.1.90"
                ],
                "changes": []
              },
              "params": [
                {
                  "textRaw": "{Buffer|string}",
                  "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=\"net.html#net_socket_setencoding_encoding\"><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'`",
              "type": "event",
              "name": "drain",
              "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'`",
              "type": "event",
              "name": "end",
              "meta": {
                "added": [
                  "v0.1.90"
                ],
                "changes": []
              },
              "params": [],
              "desc": "<p>Emitted when the other end of the socket sends a FIN packet, thus ending the\nreadable side of the socket.</p>\n<p>By default (<code>allowHalfOpen</code> is <code>false</code>) the socket will send a FIN packet\nback and destroy its file descriptor once it has written out its pending\nwrite queue. However, if <code>allowHalfOpen</code> is set to <code>true</code>, the socket will\nnot automatically <a href=\"net.html#net_socket_end_data_encoding_callback\"><code>end()</code></a> its writable side, allowing the\nuser to write arbitrary amounts of data. The user must call\n<a href=\"net.html#net_socket_end_data_encoding_callback\"><code>end()</code></a> explicitly to close the connection (i.e. sending a\nFIN packet back).</p>"
            },
            {
              "textRaw": "Event: `'error'`",
              "type": "event",
              "name": "error",
              "meta": {
                "added": [
                  "v0.1.90"
                ],
                "changes": []
              },
              "params": [
                {
                  "textRaw": "{Error}",
                  "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'`",
              "type": "event",
              "name": "lookup",
              "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": [],
              "desc": "<p>Emitted after resolving the host name but before connecting.\nNot applicable to Unix sockets.</p>\n<ul>\n<li><code>err</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error\" class=\"type\">&lt;Error&gt;</a> | <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Null_type\" class=\"type\">&lt;null&gt;</a> The error object. See <a href=\"dns.html#dns_dns_lookup_hostname_options_callback\"><code>dns.lookup()</code></a>.</li>\n<li><code>address</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string&gt;</a> The IP address.</li>\n<li><code>family</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string&gt;</a> | <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Null_type\" class=\"type\">&lt;null&gt;</a> The address type. See <a href=\"dns.html#dns_dns_lookup_hostname_options_callback\"><code>dns.lookup()</code></a>.</li>\n<li><code>host</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string&gt;</a> The host name.</li>\n</ul>"
            },
            {
              "textRaw": "Event: `'ready'`",
              "type": "event",
              "name": "ready",
              "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'`",
              "type": "event",
              "name": "timeout",
              "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=\"net.html#net_socket_settimeout_timeout_callback\"><code>socket.setTimeout()</code></a>.</p>"
            }
          ],
          "methods": [
            {
              "textRaw": "`socket.address()`",
              "type": "method",
              "name": "address",
              "meta": {
                "added": [
                  "v0.1.90"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Object}",
                    "name": "return",
                    "type": "Object"
                  },
                  "params": []
                }
              ],
              "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()`",
              "type": "method",
              "name": "connect",
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Initiate a connection on a given socket.</p>\n<p>Possible signatures:</p>\n<ul>\n<li><a href=\"net.html#net_socket_connect_options_connectlistener\"><code>socket.connect(options[, connectListener])</code></a></li>\n<li><a href=\"net.html#net_socket_connect_path_connectlistener\"><code>socket.connect(path[, connectListener])</code></a>\nfor <a href=\"net.html#net_ipc_support\">IPC</a> connections.</li>\n<li><a href=\"net.html#net_socket_connect_port_host_connectlistener\"><code>socket.connect(port[, host][, connectListener])</code></a>\nfor TCP connections.</li>\n<li>Returns: <a href=\"net.html#net_class_net_socket\" class=\"type\">&lt;net.Socket&gt;</a> The socket itself.</li>\n</ul>\n<p>This function is asynchronous. When the connection is established, the\n<a href=\"net.html#net_event_connect\"><code>'connect'</code></a> event will be emitted. If there is a problem connecting,\ninstead of a <a href=\"net.html#net_event_connect\"><code>'connect'</code></a> event, an <a href=\"net.html#net_event_error_1\"><code>'error'</code></a> event will be emitted with\nthe error passed to the <a href=\"net.html#net_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=\"net.html#net_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])`",
                  "type": "method",
                  "name": "connect",
                  "meta": {
                    "added": [
                      "v0.1.90"
                    ],
                    "changes": [
                      {
                        "version": "v12.10.0",
                        "pr-url": "https://github.com/nodejs/node/pull/25436",
                        "description": "Added `onread` option."
                      },
                      {
                        "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": [
                    {
                      "return": {
                        "textRaw": "Returns: {net.Socket} The socket itself.",
                        "name": "return",
                        "type": "net.Socket",
                        "desc": "The socket itself."
                      },
                      "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."
                        }
                      ]
                    }
                  ],
                  "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=\"net.html#net_net_createconnection\"><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>port</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;number&gt;</a> Required. Port the socket should connect to.</li>\n<li><code>host</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string&gt;</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/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string&gt;</a> Local address the socket should connect from.</li>\n<li><code>localPort</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;number&gt;</a> Local port the socket should connect from.</li>\n<li><code>family</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;number&gt;</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/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;number&gt;</a> Optional <a href=\"dns.html#dns_supported_getaddrinfo_flags\"><code>dns.lookup()</code> hints</a>.</li>\n<li><code>lookup</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function\" class=\"type\">&lt;Function&gt;</a> Custom lookup function. <strong>Default:</strong> <a href=\"dns.html#dns_dns_lookup_hostname_options_callback\"><code>dns.lookup()</code></a>.</li>\n</ul>\n<p>For <a href=\"net.html#net_ipc_support\">IPC</a> connections, available <code>options</code> are:</p>\n<ul>\n<li><code>path</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string&gt;</a> Required. Path the client should connect to.\nSee <a href=\"net.html#net_identifying_paths_for_ipc_connections\">Identifying paths for IPC connections</a>. If provided, the TCP-specific\noptions above are ignored.</li>\n</ul>\n<p>For both types, available <code>options</code> include:</p>\n<ul>\n<li>\n<p><code>onread</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object\" class=\"type\">&lt;Object&gt;</a> If specified, incoming data is stored in a single <code>buffer</code>\nand passed to the supplied <code>callback</code> when data arrives on the socket.\nThis will cause the streaming functionality to not provide any data.\nThe socket will emit events like <code>'error'</code>, <code>'end'</code>, and <code>'close'</code>\nas usual. Methods like <code>pause()</code> and <code>resume()</code> will also behave as\nexpected.</p>\n<ul>\n<li><code>buffer</code> <a href=\"buffer.html#buffer_class_buffer\" class=\"type\">&lt;Buffer&gt;</a> | <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array\" class=\"type\">&lt;Uint8Array&gt;</a> | <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function\" class=\"type\">&lt;Function&gt;</a> Either a reusable chunk of memory to\nuse for storing incoming data or a function that returns such.</li>\n<li><code>callback</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function\" class=\"type\">&lt;Function&gt;</a> This function is called for every chunk of incoming\ndata. Two arguments are passed to it: the number of bytes written to\n<code>buffer</code> and a reference to <code>buffer</code>. Return <code>false</code> from this function to\nimplicitly <code>pause()</code> the socket. This function will be executed in the\nglobal context.</li>\n</ul>\n</li>\n</ul>\n<p>Following is an example of a client using the <code>onread</code> option:</p>\n<pre><code class=\"language-js\">const net = require('net');\nnet.connect({\n  port: 80,\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": "`socket.connect(path[, connectListener])`",
                  "type": "method",
                  "name": "connect",
                  "signatures": [
                    {
                      "return": {
                        "textRaw": "Returns: {net.Socket} The socket itself.",
                        "name": "return",
                        "type": "net.Socket",
                        "desc": "The socket itself."
                      },
                      "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."
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Initiate an <a href=\"net.html#net_ipc_support\">IPC</a> connection on the given socket.</p>\n<p>Alias to\n<a href=\"net.html#net_socket_connect_options_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])`",
                  "type": "method",
                  "name": "connect",
                  "meta": {
                    "added": [
                      "v0.1.90"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "return": {
                        "textRaw": "Returns: {net.Socket} The socket itself.",
                        "name": "return",
                        "type": "net.Socket",
                        "desc": "The socket itself."
                      },
                      "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."
                        },
                        {
                          "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."
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Initiate a TCP connection on the given socket.</p>\n<p>Alias to\n<a href=\"net.html#net_socket_connect_options_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])`",
              "type": "method",
              "name": "destroy",
              "meta": {
                "added": [
                  "v0.1.90"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {net.Socket}",
                    "name": "return",
                    "type": "net.Socket"
                  },
                  "params": [
                    {
                      "textRaw": "`error` {Object}",
                      "name": "error",
                      "type": "Object"
                    }
                  ]
                }
              ],
              "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#stream_writable_destroy_error\"><code>writable.destroy()</code></a> for further details.</p>"
            },
            {
              "textRaw": "`socket.end([data[, encoding]][, callback])`",
              "type": "method",
              "name": "end",
              "meta": {
                "added": [
                  "v0.1.90"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {net.Socket} The socket itself.",
                    "name": "return",
                    "type": "net.Socket",
                    "desc": "The socket itself."
                  },
                  "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`."
                    },
                    {
                      "textRaw": "`callback` {Function} Optional callback for when the socket is finished.",
                      "name": "callback",
                      "type": "Function",
                      "desc": "Optional callback for when the socket is finished."
                    }
                  ]
                }
              ],
              "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#stream_writable_end_chunk_encoding_callback\"><code>writable.end()</code></a> for further details.</p>"
            },
            {
              "textRaw": "`socket.pause()`",
              "type": "method",
              "name": "pause",
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {net.Socket} The socket itself.",
                    "name": "return",
                    "type": "net.Socket",
                    "desc": "The socket itself."
                  },
                  "params": []
                }
              ],
              "desc": "<p>Pauses the reading of data. That is, <a href=\"net.html#net_event_data\"><code>'data'</code></a> events will not be emitted.\nUseful to throttle back an upload.</p>"
            },
            {
              "textRaw": "`socket.ref()`",
              "type": "method",
              "name": "ref",
              "meta": {
                "added": [
                  "v0.9.1"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {net.Socket} The socket itself.",
                    "name": "return",
                    "type": "net.Socket",
                    "desc": "The socket itself."
                  },
                  "params": []
                }
              ],
              "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.resume()`",
              "type": "method",
              "name": "resume",
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {net.Socket} The socket itself.",
                    "name": "return",
                    "type": "net.Socket",
                    "desc": "The socket itself."
                  },
                  "params": []
                }
              ],
              "desc": "<p>Resumes reading after a call to <a href=\"net.html#net_socket_pause\"><code>socket.pause()</code></a>.</p>"
            },
            {
              "textRaw": "`socket.setEncoding([encoding])`",
              "type": "method",
              "name": "setEncoding",
              "meta": {
                "added": [
                  "v0.1.90"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {net.Socket} The socket itself.",
                    "name": "return",
                    "type": "net.Socket",
                    "desc": "The socket itself."
                  },
                  "params": [
                    {
                      "textRaw": "`encoding` {string}",
                      "name": "encoding",
                      "type": "string"
                    }
                  ]
                }
              ],
              "desc": "<p>Set the encoding for the socket as a <a href=\"stream.html#stream_class_stream_readable\">Readable Stream</a>. See\n<a href=\"stream.html#stream_readable_setencoding_encoding\"><code>readable.setEncoding()</code></a> for more information.</p>"
            },
            {
              "textRaw": "`socket.setKeepAlive([enable][, initialDelay])`",
              "type": "method",
              "name": "setKeepAlive",
              "meta": {
                "added": [
                  "v0.1.92"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {net.Socket} The socket itself.",
                    "name": "return",
                    "type": "net.Socket",
                    "desc": "The socket itself."
                  },
                  "params": [
                    {
                      "textRaw": "`enable` {boolean} **Default:** `false`",
                      "name": "enable",
                      "type": "boolean",
                      "default": "`false`"
                    },
                    {
                      "textRaw": "`initialDelay` {number} **Default:** `0`",
                      "name": "initialDelay",
                      "type": "number",
                      "default": "`0`"
                    }
                  ]
                }
              ],
              "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>"
            },
            {
              "textRaw": "`socket.setNoDelay([noDelay])`",
              "type": "method",
              "name": "setNoDelay",
              "meta": {
                "added": [
                  "v0.1.90"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {net.Socket} The socket itself.",
                    "name": "return",
                    "type": "net.Socket",
                    "desc": "The socket itself."
                  },
                  "params": [
                    {
                      "textRaw": "`noDelay` {boolean} **Default:** `true`",
                      "name": "noDelay",
                      "type": "boolean",
                      "default": "`true`"
                    }
                  ]
                }
              ],
              "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])`",
              "type": "method",
              "name": "setTimeout",
              "meta": {
                "added": [
                  "v0.1.90"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {net.Socket} The socket itself.",
                    "name": "return",
                    "type": "net.Socket",
                    "desc": "The socket itself."
                  },
                  "params": [
                    {
                      "textRaw": "`timeout` {number}",
                      "name": "timeout",
                      "type": "number"
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function"
                    }
                  ]
                }
              ],
              "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=\"net.html#net_event_timeout\"><code>'timeout'</code></a>\nevent but the connection will not be severed. The user must manually call\n<a href=\"net.html#net_socket_end_data_encoding_callback\"><code>socket.end()</code></a> or <a href=\"net.html#net_socket_destroy_error\"><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=\"net.html#net_event_timeout\"><code>'timeout'</code></a> event.</p>"
            },
            {
              "textRaw": "`socket.unref()`",
              "type": "method",
              "name": "unref",
              "meta": {
                "added": [
                  "v0.9.1"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {net.Socket} The socket itself.",
                    "name": "return",
                    "type": "net.Socket",
                    "desc": "The socket itself."
                  },
                  "params": []
                }
              ],
              "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])`",
              "type": "method",
              "name": "write",
              "meta": {
                "added": [
                  "v0.1.90"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  },
                  "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`."
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function"
                    }
                  ]
                }
              ],
              "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=\"net.html#net_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#stream_writable_write_chunk_encoding_callback\"><code>write()</code></a> method for more\ninformation.</p>"
            }
          ],
          "properties": [
            {
              "textRaw": "`bufferSize` {integer}",
              "type": "integer",
              "name": "bufferSize",
              "meta": {
                "added": [
                  "v0.3.8"
                ],
                "changes": []
              },
              "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=\"net.html#net_socket_pause\"><code>socket.pause()</code></a> and <a href=\"net.html#net_socket_resume\"><code>socket.resume()</code></a>.</p>"
            },
            {
              "textRaw": "`bytesRead` {integer}",
              "type": "integer",
              "name": "bytesRead",
              "meta": {
                "added": [
                  "v0.5.3"
                ],
                "changes": []
              },
              "desc": "<p>The amount of received bytes.</p>"
            },
            {
              "textRaw": "`bytesWritten` {integer}",
              "type": "integer",
              "name": "bytesWritten",
              "meta": {
                "added": [
                  "v0.5.3"
                ],
                "changes": []
              },
              "desc": "<p>The amount of bytes sent.</p>"
            },
            {
              "textRaw": "`connecting` {boolean}",
              "type": "boolean",
              "name": "connecting",
              "meta": {
                "added": [
                  "v6.1.0"
                ],
                "changes": []
              },
              "desc": "<p>If <code>true</code>,\n<a href=\"net.html#net_socket_connect_options_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=\"net.html#net_socket_connect_options_connectlistener\"><code>socket.connect(options[, connectListener])</code></a>\ncallback is a listener for the <code>'connect'</code> event.</p>"
            },
            {
              "textRaw": "`destroyed` {boolean} Indicates if the connection is destroyed or not. Once a connection is destroyed no further data can be transferred using it.",
              "type": "boolean",
              "name": "destroyed",
              "desc": "<p>See <a href=\"stream.html#stream_writable_destroyed\"><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": "`localAddress` {string}",
              "type": "string",
              "name": "localAddress",
              "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": "`localPort` {integer}",
              "type": "integer",
              "name": "localPort",
              "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": "`pending` {boolean}",
              "type": "boolean",
              "name": "pending",
              "meta": {
                "added": [
                  "v11.2.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=\"net.html#net_socket_connecting\"><code>socket.connecting</code></a>).</p>"
            },
            {
              "textRaw": "`remoteAddress` {string}",
              "type": "string",
              "name": "remoteAddress",
              "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": "`remoteFamily` {string}",
              "type": "string",
              "name": "remoteFamily",
              "meta": {
                "added": [
                  "v0.11.14"
                ],
                "changes": []
              },
              "desc": "<p>The string representation of the remote IP family. <code>'IPv4'</code> or <code>'IPv6'</code>.</p>"
            },
            {
              "textRaw": "`remotePort` {integer}",
              "type": "integer",
              "name": "remotePort",
              "meta": {
                "added": [
                  "v0.5.10"
                ],
                "changes": []
              },
              "desc": "<p>The numeric representation of the remote port. For example, <code>80</code> or <code>21</code>.</p>"
            }
          ],
          "signatures": [
            {
              "return": {
                "textRaw": "Returns: {net.Socket}",
                "name": "return",
                "type": "net.Socket"
              },
              "params": [
                {
                  "textRaw": "`options` {Object} Available options are:",
                  "name": "options",
                  "type": "Object",
                  "desc": "Available options are:",
                  "options": [
                    {
                      "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": "`allowHalfOpen` {boolean} Indicates whether half-opened TCP connections are allowed. See [`net.createServer()`][] and the [`'end'`][] event for details. **Default:** `false`.",
                      "name": "allowHalfOpen",
                      "type": "boolean",
                      "default": "`false`",
                      "desc": "Indicates whether half-opened TCP connections are allowed. See [`net.createServer()`][] and the [`'end'`][] event for details."
                    },
                    {
                      "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": "`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."
                    }
                  ]
                }
              ],
              "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=\"net.html#net_ipc_support\">IPC</a>\nendpoint, depending on what it <a href=\"net.html#net_socket_connect\"><code>connect()</code></a> to.</p>"
            }
          ]
        }
      ],
      "methods": [
        {
          "textRaw": "`net.connect()`",
          "type": "method",
          "name": "connect",
          "signatures": [
            {
              "params": []
            }
          ],
          "desc": "<p>Aliases to\n<a href=\"net.html#net_net_createconnection\"><code>net.createConnection()</code></a>.</p>\n<p>Possible signatures:</p>\n<ul>\n<li><a href=\"net.html#net_net_connect_options_connectlistener\"><code>net.connect(options[, connectListener])</code></a></li>\n<li><a href=\"net.html#net_net_connect_path_connectlistener\"><code>net.connect(path[, connectListener])</code></a> for <a href=\"net.html#net_ipc_support\">IPC</a>\nconnections.</li>\n<li><a href=\"net.html#net_net_connect_port_host_connectlistener\"><code>net.connect(port[, host][, connectListener])</code></a>\nfor TCP connections.</li>\n</ul>",
          "methods": [
            {
              "textRaw": "`net.connect(options[, connectListener])`",
              "type": "method",
              "name": "connect",
              "meta": {
                "added": [
                  "v0.7.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {net.Socket}",
                    "name": "return",
                    "type": "net.Socket"
                  },
                  "params": [
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object"
                    },
                    {
                      "textRaw": "`connectListener` {Function}",
                      "name": "connectListener",
                      "type": "Function"
                    }
                  ]
                }
              ],
              "desc": "<p>Alias to\n<a href=\"net.html#net_net_createconnection_options_connectlistener\"><code>net.createConnection(options[, connectListener])</code></a>.</p>"
            },
            {
              "textRaw": "`net.connect(path[, connectListener])`",
              "type": "method",
              "name": "connect",
              "meta": {
                "added": [
                  "v0.1.90"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {net.Socket}",
                    "name": "return",
                    "type": "net.Socket"
                  },
                  "params": [
                    {
                      "textRaw": "`path` {string}",
                      "name": "path",
                      "type": "string"
                    },
                    {
                      "textRaw": "`connectListener` {Function}",
                      "name": "connectListener",
                      "type": "Function"
                    }
                  ]
                }
              ],
              "desc": "<p>Alias to\n<a href=\"net.html#net_net_createconnection_path_connectlistener\"><code>net.createConnection(path[, connectListener])</code></a>.</p>"
            },
            {
              "textRaw": "`net.connect(port[, host][, connectListener])`",
              "type": "method",
              "name": "connect",
              "meta": {
                "added": [
                  "v0.1.90"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {net.Socket}",
                    "name": "return",
                    "type": "net.Socket"
                  },
                  "params": [
                    {
                      "textRaw": "`port` {number}",
                      "name": "port",
                      "type": "number"
                    },
                    {
                      "textRaw": "`host` {string}",
                      "name": "host",
                      "type": "string"
                    },
                    {
                      "textRaw": "`connectListener` {Function}",
                      "name": "connectListener",
                      "type": "Function"
                    }
                  ]
                }
              ],
              "desc": "<p>Alias to\n<a href=\"net.html#net_net_createconnection_port_host_connectlistener\"><code>net.createConnection(port[, host][, connectListener])</code></a>.</p>"
            }
          ]
        },
        {
          "textRaw": "`net.createConnection()`",
          "type": "method",
          "name": "createConnection",
          "signatures": [
            {
              "params": []
            }
          ],
          "desc": "<p>A factory function, which creates a new <a href=\"net.html#net_class_net_socket\"><code>net.Socket</code></a>,\nimmediately initiates connection with <a href=\"net.html#net_socket_connect\"><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=\"net.html#net_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=\"net.html#net_event_connect\"><code>'connect'</code></a> event <strong>once</strong>.</p>\n<p>Possible signatures:</p>\n<ul>\n<li><a href=\"net.html#net_net_createconnection_options_connectlistener\"><code>net.createConnection(options[, connectListener])</code></a></li>\n<li><a href=\"net.html#net_net_createconnection_path_connectlistener\"><code>net.createConnection(path[, connectListener])</code></a>\nfor <a href=\"net.html#net_ipc_support\">IPC</a> connections.</li>\n<li><a href=\"net.html#net_net_createconnection_port_host_connectlistener\"><code>net.createConnection(port[, host][, connectListener])</code></a>\nfor TCP connections.</li>\n</ul>\n<p>The <a href=\"net.html#net_net_connect\"><code>net.connect()</code></a> function is an alias to this function.</p>",
          "methods": [
            {
              "textRaw": "`net.createConnection(options[, connectListener])`",
              "type": "method",
              "name": "createConnection",
              "meta": {
                "added": [
                  "v0.1.90"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "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."
                  },
                  "params": [
                    {
                      "textRaw": "`options` {Object} Required. Will be passed to both the [`new net.Socket([options])`][`new net.Socket(options)`] call and the [`socket.connect(options[, connectListener])`][`socket.connect(options)`] method.",
                      "name": "options",
                      "type": "Object",
                      "desc": "Required. Will be passed to both the [`new net.Socket([options])`][`new net.Socket(options)`] call and the [`socket.connect(options[, connectListener])`][`socket.connect(options)`] 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."
                    }
                  ]
                }
              ],
              "desc": "<p>For available options, see\n<a href=\"net.html#net_new_net_socket_options\"><code>new net.Socket([options])</code></a>\nand <a href=\"net.html#net_socket_connect_options_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/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;number&gt;</a> If set, will be used to call\n<a href=\"net.html#net_socket_settimeout_timeout_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=\"net.html#net_net_createserver_options_connectionlistener\"><code>net.createServer()</code></a> section:</p>\n<pre><code class=\"language-js\">const net = require('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>"
            },
            {
              "textRaw": "`net.createConnection(path[, connectListener])`",
              "type": "method",
              "name": "createConnection",
              "meta": {
                "added": [
                  "v0.1.90"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "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."
                  },
                  "params": [
                    {
                      "textRaw": "`path` {string} Path the socket should connect to. Will be passed to [`socket.connect(path[, connectListener])`][`socket.connect(path)`]. 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])`][`socket.connect(path)`]. 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])`][`socket.connect(path)`].",
                      "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])`][`socket.connect(path)`]."
                    }
                  ]
                }
              ],
              "desc": "<p>Initiates an <a href=\"net.html#net_ipc_support\">IPC</a> connection.</p>\n<p>This function creates a new <a href=\"net.html#net_class_net_socket\"><code>net.Socket</code></a> with all options set to default,\nimmediately initiates connection with\n<a href=\"net.html#net_socket_connect_path_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])`",
              "type": "method",
              "name": "createConnection",
              "meta": {
                "added": [
                  "v0.1.90"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "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."
                  },
                  "params": [
                    {
                      "textRaw": "`port` {number} Port the socket should connect to. Will be passed to [`socket.connect(port[, host][, connectListener])`][`socket.connect(port)`].",
                      "name": "port",
                      "type": "number",
                      "desc": "Port the socket should connect to. Will be passed to [`socket.connect(port[, host][, connectListener])`][`socket.connect(port)`]."
                    },
                    {
                      "textRaw": "`host` {string} Host the socket should connect to. Will be passed to [`socket.connect(port[, host][, connectListener])`][`socket.connect(port)`]. **Default:** `'localhost'`.",
                      "name": "host",
                      "type": "string",
                      "default": "`'localhost'`",
                      "desc": "Host the socket should connect to. Will be passed to [`socket.connect(port[, host][, connectListener])`][`socket.connect(port)`]."
                    },
                    {
                      "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])`][`socket.connect(port)`].",
                      "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])`][`socket.connect(port)`]."
                    }
                  ]
                }
              ],
              "desc": "<p>Initiates a TCP connection.</p>\n<p>This function creates a new <a href=\"net.html#net_class_net_socket\"><code>net.Socket</code></a> with all options set to default,\nimmediately initiates connection with\n<a href=\"net.html#net_socket_connect_port_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])`",
          "type": "method",
          "name": "createServer",
          "meta": {
            "added": [
              "v0.5.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "return": {
                "textRaw": "Returns: {net.Server}",
                "name": "return",
                "type": "net.Server"
              },
              "params": [
                {
                  "textRaw": "`options` {Object}",
                  "name": "options",
                  "type": "Object",
                  "options": [
                    {
                      "textRaw": "`allowHalfOpen` {boolean} Indicates whether half-opened TCP connections are allowed. **Default:** `false`.",
                      "name": "allowHalfOpen",
                      "type": "boolean",
                      "default": "`false`",
                      "desc": "Indicates whether half-opened TCP connections are allowed."
                    },
                    {
                      "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": "`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."
                }
              ]
            }
          ],
          "desc": "<p>Creates a new TCP or <a href=\"net.html#net_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\nsends a FIN packet, the server will only send a FIN packet back when\n<a href=\"net.html#net_socket_end_data_encoding_callback\"><code>socket.end()</code></a> is explicitly called, until then the connection is\nhalf-closed (non-readable but still writable). See <a href=\"net.html#net_event_end\"><code>'end'</code></a> event\nand <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=\"net.html#net_socket_resume\"><code>socket.resume()</code></a>.</p>\n<p>The server can be a TCP server or an <a href=\"net.html#net_ipc_support\">IPC</a> server, depending on what it\n<a href=\"net.html#net_server_listen\"><code>listen()</code></a> to.</p>\n<p>Here is an example of an TCP echo server which listens for connections\non port 8124:</p>\n<pre><code class=\"language-js\">const net = require('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-console\">$ 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-console\">$ nc -U /tmp/echo.sock\n</code></pre>"
        },
        {
          "textRaw": "`net.isIP(input)`",
          "type": "method",
          "name": "isIP",
          "meta": {
            "added": [
              "v0.3.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "return": {
                "textRaw": "Returns: {integer}",
                "name": "return",
                "type": "integer"
              },
              "params": [
                {
                  "textRaw": "`input` {string}",
                  "name": "input",
                  "type": "string"
                }
              ]
            }
          ],
          "desc": "<p>Tests if input is an IP address. Returns <code>0</code> for invalid strings,\nreturns <code>4</code> for IP version 4 addresses, and returns <code>6</code> for IP version 6\naddresses.</p>"
        },
        {
          "textRaw": "`net.isIPv4(input)`",
          "type": "method",
          "name": "isIPv4",
          "meta": {
            "added": [
              "v0.3.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "return": {
                "textRaw": "Returns: {boolean}",
                "name": "return",
                "type": "boolean"
              },
              "params": [
                {
                  "textRaw": "`input` {string}",
                  "name": "input",
                  "type": "string"
                }
              ]
            }
          ],
          "desc": "<p>Returns <code>true</code> if input is a version 4 IP address, otherwise returns <code>false</code>.</p>"
        },
        {
          "textRaw": "`net.isIPv6(input)`",
          "type": "method",
          "name": "isIPv6",
          "meta": {
            "added": [
              "v0.3.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "return": {
                "textRaw": "Returns: {boolean}",
                "name": "return",
                "type": "boolean"
              },
              "params": [
                {
                  "textRaw": "`input` {string}",
                  "name": "input",
                  "type": "string"
                }
              ]
            }
          ],
          "desc": "<p>Returns <code>true</code> if input is a version 6 IP address, otherwise returns <code>false</code>.</p>"
        }
      ],
      "type": "module",
      "displayName": "Net"
    },
    {
      "textRaw": "OS",
      "name": "os",
      "introduced_in": "v0.10.0",
      "stability": 2,
      "stabilityText": "Stable",
      "desc": "<p>The <code>os</code> module provides operating system-related utility methods and\nproperties. It can be accessed using:</p>\n<pre><code class=\"language-js\">const os = require('os');\n</code></pre>",
      "properties": [
        {
          "textRaw": "`EOL` {string}",
          "type": "string",
          "name": "EOL",
          "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": "`constants` {Object}",
          "type": "Object",
          "name": "constants",
          "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.html#os_os_constants_1\">OS constants</a>.</p>"
        }
      ],
      "methods": [
        {
          "textRaw": "`os.arch()`",
          "type": "method",
          "name": "arch",
          "meta": {
            "added": [
              "v0.5.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "return": {
                "textRaw": "Returns: {string}",
                "name": "return",
                "type": "string"
              },
              "params": []
            }
          ],
          "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>'mips'</code>,\n<code>'mipsel'</code>, <code>'ppc'</code>, <code>'ppc64'</code>, <code>'s390'</code>, <code>'s390x'</code>, <code>'x32'</code>, and <code>'x64'</code>.</p>\n<p>The return value is equivalent to <a href=\"process.html#process_process_arch\"><code>process.arch</code></a>.</p>"
        },
        {
          "textRaw": "`os.cpus()`",
          "type": "method",
          "name": "cpus",
          "meta": {
            "added": [
              "v0.3.3"
            ],
            "changes": []
          },
          "signatures": [
            {
              "return": {
                "textRaw": "Returns: {Object[]}",
                "name": "return",
                "type": "Object[]"
              },
              "params": []
            }
          ],
          "desc": "<p>Returns an array of objects containing information about each logical CPU core.</p>\n<p>The properties included on each object include:</p>\n<ul>\n<li><code>model</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string&gt;</a></li>\n<li><code>speed</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;number&gt;</a> (in MHz)</li>\n<li>\n<p><code>times</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object\" class=\"type\">&lt;Object&gt;</a></p>\n<ul>\n<li><code>user</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;number&gt;</a> The number of milliseconds the CPU has spent in user mode.</li>\n<li><code>nice</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;number&gt;</a> The number of milliseconds the CPU has spent in nice mode.</li>\n<li><code>sys</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;number&gt;</a> The number of milliseconds the CPU has spent in sys mode.</li>\n<li><code>idle</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;number&gt;</a> The number of milliseconds the CPU has spent in idle mode.</li>\n<li><code>irq</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;number&gt;</a> The number of milliseconds the CPU has spent in irq mode.</li>\n</ul>\n</li>\n</ul>\n<!-- eslint-disable semi -->\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>"
        },
        {
          "textRaw": "`os.endianness()`",
          "type": "method",
          "name": "endianness",
          "meta": {
            "added": [
              "v0.9.4"
            ],
            "changes": []
          },
          "signatures": [
            {
              "return": {
                "textRaw": "Returns: {string}",
                "name": "return",
                "type": "string"
              },
              "params": []
            }
          ],
          "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()`",
          "type": "method",
          "name": "freemem",
          "meta": {
            "added": [
              "v0.3.3"
            ],
            "changes": []
          },
          "signatures": [
            {
              "return": {
                "textRaw": "Returns: {integer}",
                "name": "return",
                "type": "integer"
              },
              "params": []
            }
          ],
          "desc": "<p>Returns the amount of free system memory in bytes as an integer.</p>"
        },
        {
          "textRaw": "`os.getPriority([pid])`",
          "type": "method",
          "name": "getPriority",
          "meta": {
            "added": [
              "v10.10.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "return": {
                "textRaw": "Returns: {integer}",
                "name": "return",
                "type": "integer"
              },
              "params": [
                {
                  "textRaw": "`pid` {integer} The process ID to retrieve scheduling priority for. **Default** `0`.",
                  "name": "pid",
                  "type": "integer",
                  "desc": "The process ID to retrieve scheduling priority for. **Default** `0`."
                }
              ]
            }
          ],
          "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()`",
          "type": "method",
          "name": "homedir",
          "meta": {
            "added": [
              "v2.3.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "return": {
                "textRaw": "Returns: {string}",
                "name": "return",
                "type": "string"
              },
              "params": []
            }
          ],
          "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()`",
          "type": "method",
          "name": "hostname",
          "meta": {
            "added": [
              "v0.3.3"
            ],
            "changes": []
          },
          "signatures": [
            {
              "return": {
                "textRaw": "Returns: {string}",
                "name": "return",
                "type": "string"
              },
              "params": []
            }
          ],
          "desc": "<p>Returns the host name of the operating system as a string.</p>"
        },
        {
          "textRaw": "`os.loadavg()`",
          "type": "method",
          "name": "loadavg",
          "meta": {
            "added": [
              "v0.3.3"
            ],
            "changes": []
          },
          "signatures": [
            {
              "return": {
                "textRaw": "Returns: {number[]}",
                "name": "return",
                "type": "number[]"
              },
              "params": []
            }
          ],
          "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.networkInterfaces()`",
          "type": "method",
          "name": "networkInterfaces",
          "meta": {
            "added": [
              "v0.6.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "return": {
                "textRaw": "Returns: {Object}",
                "name": "return",
                "type": "Object"
              },
              "params": []
            }
          ],
          "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/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string&gt;</a> The assigned IPv4 or IPv6 address</li>\n<li><code>netmask</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string&gt;</a> The IPv4 or IPv6 network mask</li>\n<li><code>family</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string&gt;</a> Either <code>IPv4</code> or <code>IPv6</code></li>\n<li><code>mac</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string&gt;</a> The MAC address of the network interface</li>\n<li><code>internal</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type\" class=\"type\">&lt;boolean&gt;</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/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;number&gt;</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/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string&gt;</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<!-- eslint-skip -->\n<pre><code class=\"language-js\">{\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()`",
          "type": "method",
          "name": "platform",
          "meta": {
            "added": [
              "v0.5.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "return": {
                "textRaw": "Returns: {string}",
                "name": "return",
                "type": "string"
              },
              "params": []
            }
          ],
          "desc": "<p>Returns a string identifying the operating system platform. The value is set\nat compile time. Possible values are <code>'aix'</code>, <code>'darwin'</code>, <code>'freebsd'</code>,\n<code>'linux'</code>, <code>'openbsd'</code>, <code>'sunos'</code>, and <code>'win32'</code>.</p>\n<p>The return value is equivalent to <a href=\"process.html#process_process_platform\"><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/master/BUILDING.md#androidandroid-based-devices-eg-firefox-os\">Android support is experimental</a>.</p>"
        },
        {
          "textRaw": "`os.release()`",
          "type": "method",
          "name": "release",
          "meta": {
            "added": [
              "v0.3.3"
            ],
            "changes": []
          },
          "signatures": [
            {
              "return": {
                "textRaw": "Returns: {string}",
                "name": "return",
                "type": "string"
              },
              "params": []
            }
          ],
          "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\"><a href=\"https://linux.die.net/man/3/uname\"><code>uname(3)</code></a></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)`",
          "type": "method",
          "name": "setPriority",
          "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",
                  "desc": "The process ID to set scheduling priority for. **Default** `0`."
                },
                {
                  "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()`",
          "type": "method",
          "name": "tmpdir",
          "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": [
            {
              "return": {
                "textRaw": "Returns: {string}",
                "name": "return",
                "type": "string"
              },
              "params": []
            }
          ],
          "desc": "<p>Returns the operating system's default directory for temporary files as a\nstring.</p>"
        },
        {
          "textRaw": "`os.totalmem()`",
          "type": "method",
          "name": "totalmem",
          "meta": {
            "added": [
              "v0.3.3"
            ],
            "changes": []
          },
          "signatures": [
            {
              "return": {
                "textRaw": "Returns: {integer}",
                "name": "return",
                "type": "integer"
              },
              "params": []
            }
          ],
          "desc": "<p>Returns the total amount of system memory in bytes as an integer.</p>"
        },
        {
          "textRaw": "`os.type()`",
          "type": "method",
          "name": "type",
          "meta": {
            "added": [
              "v0.3.3"
            ],
            "changes": []
          },
          "signatures": [
            {
              "return": {
                "textRaw": "Returns: {string}",
                "name": "return",
                "type": "string"
              },
              "params": []
            }
          ],
          "desc": "<p>Returns the operating system name as returned by <a href=\"https://linux.die.net/man/3/uname\"><a href=\"https://linux.die.net/man/3/uname\"><code>uname(3)</code></a></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\"><a href=\"https://linux.die.net/man/3/uname\"><code>uname(3)</code></a></a> on various operating systems.</p>"
        },
        {
          "textRaw": "`os.uptime()`",
          "type": "method",
          "name": "uptime",
          "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": [
            {
              "return": {
                "textRaw": "Returns: {integer}",
                "name": "return",
                "type": "integer"
              },
              "params": []
            }
          ],
          "desc": "<p>Returns the system uptime in number of seconds.</p>"
        },
        {
          "textRaw": "`os.userInfo([options])`",
          "type": "method",
          "name": "userInfo",
          "meta": {
            "added": [
              "v6.0.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "return": {
                "textRaw": "Returns: {Object}",
                "name": "return",
                "type": "Object"
              },
              "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."
                    }
                  ]
                }
              ]
            }
          ],
          "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#errors_class_systemerror\"><code>SystemError</code></a> if a user has no <code>username</code> or <code>homedir</code>.</p>"
        },
        {
          "textRaw": "`os.version()`",
          "type": "method",
          "name": "version",
          "meta": {
            "added": [
              "v12.17.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "return": {
                "textRaw": "Returns {string}",
                "name": "return",
                "type": "string"
              },
              "params": []
            }
          ],
          "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\"><a href=\"https://linux.die.net/man/3/uname\"><code>uname(3)</code></a></a>. On Windows, <code>RtlGetVersion()</code> is used, and if it is not available,\n<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",
          "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",
              "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    (<code>(Ctrl+C)</code>).</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>",
              "type": "module",
              "displayName": "Signal constants"
            },
            {
              "textRaw": "Error constants",
              "name": "error_constants",
              "desc": "<p>The following error constants are exported by <code>os.constants.errno</code>.</p>",
              "modules": [
                {
                  "textRaw": "POSIX error constants",
                  "name": "posix_error_constants",
                  "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.\n  </tr>\n</table>",
                  "type": "module",
                  "displayName": "POSIX error constants"
                },
                {
                  "textRaw": "Windows-specific error constants",
                  "name": "windows-specific_error_constants",
                  "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>",
                  "type": "module",
                  "displayName": "Windows-specific error constants"
                }
              ],
              "type": "module",
              "displayName": "Error constants"
            },
            {
              "textRaw": "dlopen constants",
              "name": "dlopen_constants",
              "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>",
              "type": "module",
              "displayName": "dlopen constants"
            },
            {
              "textRaw": "Priority constants",
              "name": "priority_constants",
              "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>",
              "type": "module",
              "displayName": "Priority constants"
            },
            {
              "textRaw": "libuv constants",
              "name": "libuv_constants",
              "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>",
              "type": "module",
              "displayName": "libuv constants"
            }
          ],
          "type": "module",
          "displayName": "OS constants"
        }
      ],
      "type": "module",
      "displayName": "OS"
    },
    {
      "textRaw": "Path",
      "name": "path",
      "introduced_in": "v0.10.0",
      "stability": 2,
      "stabilityText": "Stable",
      "desc": "<p>The <code>path</code> module provides utilities for working with file and directory paths.\nIt can be accessed using:</p>\n<pre><code class=\"language-js\">const path = require('path');\n</code></pre>",
      "modules": [
        {
          "textRaw": "Windows vs. POSIX",
          "name": "windows_vs._posix",
          "desc": "<p>The default operation of the <code>path</code> module varies based on the operating system\non which a Node.js application is running. Specifically, when running on a\nWindows operating system, the <code>path</code> module will assume that Windows-style\npaths 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=\"path.html#path_path_win32\"><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=\"path.html#path_path_posix\"><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>",
          "type": "module",
          "displayName": "Windows vs. POSIX"
        }
      ],
      "methods": [
        {
          "textRaw": "`path.basename(path[, ext])`",
          "type": "method",
          "name": "basename",
          "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": [
            {
              "return": {
                "textRaw": "Returns: {string}",
                "name": "return",
                "type": "string"
              },
              "params": [
                {
                  "textRaw": "`path` {string}",
                  "name": "path",
                  "type": "string"
                },
                {
                  "textRaw": "`ext` {string} An optional file extension",
                  "name": "ext",
                  "type": "string",
                  "desc": "An optional file extension"
                }
              ]
            }
          ],
          "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 directory separators are ignored, see\n<a href=\"path.html#path_path_sep\"><code>path.sep</code></a>.</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>A <a href=\"errors.html#errors_class_typeerror\"><code>TypeError</code></a> is thrown if <code>path</code> is not a string or if <code>ext</code> is given\nand is not a string.</p>"
        },
        {
          "textRaw": "`path.dirname(path)`",
          "type": "method",
          "name": "dirname",
          "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": [
            {
              "return": {
                "textRaw": "Returns: {string}",
                "name": "return",
                "type": "string"
              },
              "params": [
                {
                  "textRaw": "`path` {string}",
                  "name": "path",
                  "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=\"path.html#path_path_sep\"><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#errors_class_typeerror\"><code>TypeError</code></a> is thrown if <code>path</code> is not a string.</p>"
        },
        {
          "textRaw": "`path.extname(path)`",
          "type": "method",
          "name": "extname",
          "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": [
            {
              "return": {
                "textRaw": "Returns: {string}",
                "name": "return",
                "type": "string"
              },
              "params": [
                {
                  "textRaw": "`path` {string}",
                  "name": "path",
                  "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#errors_class_typeerror\"><code>TypeError</code></a> is thrown if <code>path</code> is not a string.</p>"
        },
        {
          "textRaw": "`path.format(pathObject)`",
          "type": "method",
          "name": "format",
          "meta": {
            "added": [
              "v0.11.15"
            ],
            "changes": []
          },
          "signatures": [
            {
              "return": {
                "textRaw": "Returns: {string}",
                "name": "return",
                "type": "string"
              },
              "params": [
                {
                  "textRaw": "`pathObject` {Object}",
                  "name": "pathObject",
                  "type": "Object",
                  "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"
                    }
                  ]
                }
              ]
            }
          ],
          "desc": "<p>The <code>path.format()</code> method returns a path string from an object. This is the\nopposite of <a href=\"path.html#path_path_parse_path\"><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</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.isAbsolute(path)`",
          "type": "method",
          "name": "isAbsolute",
          "meta": {
            "added": [
              "v0.11.2"
            ],
            "changes": []
          },
          "signatures": [
            {
              "return": {
                "textRaw": "Returns: {boolean}",
                "name": "return",
                "type": "boolean"
              },
              "params": [
                {
                  "textRaw": "`path` {string}",
                  "name": "path",
                  "type": "string"
                }
              ]
            }
          ],
          "desc": "<p>The <code>path.isAbsolute()</code> method determines if <code>path</code> is an absolute path.</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('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#errors_class_typeerror\"><code>TypeError</code></a> is thrown if <code>path</code> is not a string.</p>"
        },
        {
          "textRaw": "`path.join([...paths])`",
          "type": "method",
          "name": "join",
          "meta": {
            "added": [
              "v0.1.16"
            ],
            "changes": []
          },
          "signatures": [
            {
              "return": {
                "textRaw": "Returns: {string}",
                "name": "return",
                "type": "string"
              },
              "params": [
                {
                  "textRaw": "`...paths` {string} A sequence of path segments",
                  "name": "...paths",
                  "type": "string",
                  "desc": "A sequence of path segments"
                }
              ]
            }
          ],
          "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#errors_class_typeerror\"><code>TypeError</code></a> is thrown if any of the path segments is not a string.</p>"
        },
        {
          "textRaw": "`path.normalize(path)`",
          "type": "method",
          "name": "normalize",
          "meta": {
            "added": [
              "v0.1.23"
            ],
            "changes": []
          },
          "signatures": [
            {
              "return": {
                "textRaw": "Returns: {string}",
                "name": "return",
                "type": "string"
              },
              "params": [
                {
                  "textRaw": "`path` {string}",
                  "name": "path",
                  "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>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#errors_class_typeerror\"><code>TypeError</code></a> is thrown if <code>path</code> is not a string.</p>"
        },
        {
          "textRaw": "`path.parse(path)`",
          "type": "method",
          "name": "parse",
          "meta": {
            "added": [
              "v0.11.15"
            ],
            "changes": []
          },
          "signatures": [
            {
              "return": {
                "textRaw": "Returns: {Object}",
                "name": "return",
                "type": "Object"
              },
              "params": [
                {
                  "textRaw": "`path` {string}",
                  "name": "path",
                  "type": "string"
                }
              ]
            }
          ],
          "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=\"path.html#path_path_sep\"><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/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string&gt;</a></li>\n<li><code>root</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string&gt;</a></li>\n<li><code>base</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string&gt;</a></li>\n<li><code>name</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string&gt;</a></li>\n<li><code>ext</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string&gt;</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#errors_class_typeerror\"><code>TypeError</code></a> is thrown if <code>path</code> is not a string.</p>"
        },
        {
          "textRaw": "`path.relative(from, to)`",
          "type": "method",
          "name": "relative",
          "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": [
            {
              "return": {
                "textRaw": "Returns: {string}",
                "name": "return",
                "type": "string"
              },
              "params": [
                {
                  "textRaw": "`from` {string}",
                  "name": "from",
                  "type": "string"
                },
                {
                  "textRaw": "`to` {string}",
                  "name": "to",
                  "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#errors_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])`",
          "type": "method",
          "name": "resolve",
          "meta": {
            "added": [
              "v0.3.4"
            ],
            "changes": []
          },
          "signatures": [
            {
              "return": {
                "textRaw": "Returns: {string}",
                "name": "return",
                "type": "string"
              },
              "params": [
                {
                  "textRaw": "`...paths` {string} A sequence of paths or path segments",
                  "name": "...paths",
                  "type": "string",
                  "desc": "A sequence of paths or path segments"
                }
              ]
            }
          ],
          "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#errors_class_typeerror\"><code>TypeError</code></a> is thrown if any of the arguments is not a string.</p>"
        },
        {
          "textRaw": "`path.toNamespacedPath(path)`",
          "type": "method",
          "name": "toNamespacedPath",
          "meta": {
            "added": [
              "v9.0.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "return": {
                "textRaw": "Returns: {string}",
                "name": "return",
                "type": "string"
              },
              "params": [
                {
                  "textRaw": "`path` {string}",
                  "name": "path",
                  "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 system. On POSIX systems, the\nmethod is non-operational and always returns <code>path</code> without modifications.</p>"
        }
      ],
      "properties": [
        {
          "textRaw": "`delimiter` {string}",
          "type": "string",
          "name": "delimiter",
          "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": "`posix` {Object}",
          "type": "Object",
          "name": "posix",
          "meta": {
            "added": [
              "v0.11.15"
            ],
            "changes": []
          },
          "desc": "<p>The <code>path.posix</code> property provides access to POSIX specific implementations\nof the <code>path</code> methods.</p>"
        },
        {
          "textRaw": "`sep` {string}",
          "type": "string",
          "name": "sep",
          "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": "`win32` {Object}",
          "type": "Object",
          "name": "win32",
          "meta": {
            "added": [
              "v0.11.15"
            ],
            "changes": []
          },
          "desc": "<p>The <code>path.win32</code> property provides access to Windows-specific implementations\nof the <code>path</code> methods.</p>"
        }
      ],
      "type": "module",
      "displayName": "Path"
    },
    {
      "textRaw": "Performance measurement APIs",
      "name": "performance_measurement_apis",
      "introduced_in": "v8.5.0",
      "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</ul>\n<pre><code class=\"language-js\">const { PerformanceObserver, performance } = require('perf_hooks');\n\nconst obs = new PerformanceObserver((items) => {\n  console.log(items.getEntries()[0].duration);\n  performance.clearMarks();\n});\nobs.observe({ entryTypes: ['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>",
      "properties": [
        {
          "textRaw": "`perf_hooks.performance`",
          "name": "performance",
          "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])`",
              "type": "method",
              "name": "clearMarks",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`name` {string}",
                      "name": "name",
                      "type": "string"
                    }
                  ]
                }
              ],
              "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.mark([name])`",
              "type": "method",
              "name": "mark",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`name` {string}",
                      "name": "name",
                      "type": "string"
                    }
                  ]
                }
              ],
              "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>"
            },
            {
              "textRaw": "`performance.measure(name[, startMark[, endMark]])`",
              "type": "method",
              "name": "measure",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": [
                  {
                    "version": "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": "`startMark` {string} Optional.",
                      "name": "startMark",
                      "type": "string",
                      "desc": "Optional."
                    },
                    {
                      "textRaw": "`endMark` {string} Optional.",
                      "name": "endMark",
                      "type": "string",
                      "desc": "Optional."
                    }
                  ]
                }
              ],
              "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, then <code>startMark</code> is set to <a href=\"https://w3c.github.io/hr-time/#dom-performance-timeorigin\"><code>timeOrigin</code></a> by default.</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>"
            },
            {
              "textRaw": "`performance.now()`",
              "type": "method",
              "name": "now",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {number}",
                    "name": "return",
                    "type": "number"
                  },
                  "params": []
                }
              ],
              "desc": "<p>Returns the current high resolution millisecond timestamp, where 0 represents\nthe start of the current <code>node</code> process.</p>"
            },
            {
              "textRaw": "`performance.timerify(fn)`",
              "type": "method",
              "name": "timerify",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`fn` {Function}",
                      "name": "fn",
                      "type": "Function"
                    }
                  ]
                }
              ],
              "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-js\">const {\n  performance,\n  PerformanceObserver\n} = require('perf_hooks');\n\nfunction someFunction() {\n  console.log('hello world');\n}\n\nconst wrapped = performance.timerify(someFunction);\n\nconst obs = new PerformanceObserver((list) => {\n  console.log(list.getEntries()[0].duration);\n  obs.disconnect();\n});\nobs.observe({ entryTypes: ['function'] });\n\n// A performance timeline entry will be created\nwrapped();\n</code></pre>"
            }
          ],
          "properties": [
            {
              "textRaw": "`nodeTiming` {PerformanceNodeTiming}",
              "type": "PerformanceNodeTiming",
              "name": "nodeTiming",
              "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": "`timeOrigin` {number}",
              "type": "number",
              "name": "timeOrigin",
              "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`",
          "type": "class",
          "name": "PerformanceEntry",
          "meta": {
            "added": [
              "v8.5.0"
            ],
            "changes": []
          },
          "properties": [
            {
              "textRaw": "`duration` {number}",
              "type": "number",
              "name": "duration",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": []
              },
              "desc": "<p>The total number of milliseconds elapsed for this entry. This value will not\nbe meaningful for all Performance Entry types.</p>"
            },
            {
              "textRaw": "`name` {string}",
              "type": "string",
              "name": "name",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": []
              },
              "desc": "<p>The name of the performance entry.</p>"
            },
            {
              "textRaw": "`startTime` {number}",
              "type": "number",
              "name": "startTime",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": []
              },
              "desc": "<p>The high resolution millisecond timestamp marking the starting time of the\nPerformance Entry.</p>"
            },
            {
              "textRaw": "`entryType` {string}",
              "type": "string",
              "name": "entryType",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": []
              },
              "desc": "<p>The type of the performance entry. It may be one of:</p>\n<ul>\n<li><code>'node'</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>'gc'</code> (Node.js only)</li>\n<li><code>'function'</code> (Node.js only)</li>\n<li><code>'http2'</code> (Node.js only)</li>\n<li><code>'http'</code> (Node.js only)</li>\n</ul>"
            },
            {
              "textRaw": "`kind` {number}",
              "type": "number",
              "name": "kind",
              "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>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>"
            },
            {
              "textRaw": "`flags` {number}",
              "type": "number",
              "name": "flags",
              "meta": {
                "added": [
                  "v12.17.0"
                ],
                "changes": []
              },
              "desc": "<p><em>This property is an extension by Node.js. It is not available in Web browsers.</em></p>\n<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": "Class: `PerformanceNodeTiming extends PerformanceEntry`",
          "type": "class",
          "name": "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>Provides timing details for Node.js itself. The constructor of this class\nis not exposed to users.</p>",
          "properties": [
            {
              "textRaw": "`bootstrapComplete` {number}",
              "type": "number",
              "name": "bootstrapComplete",
              "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": "`environment` {number}",
              "type": "number",
              "name": "environment",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": []
              },
              "desc": "<p>The high resolution millisecond timestamp at which the Node.js environment was\ninitialized.</p>"
            },
            {
              "textRaw": "`loopExit` {number}",
              "type": "number",
              "name": "loopExit",
              "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#process_event_exit\"><code>'exit'</code></a> event.</p>"
            },
            {
              "textRaw": "`loopStart` {number}",
              "type": "number",
              "name": "loopStart",
              "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": "`nodeStart` {number}",
              "type": "number",
              "name": "nodeStart",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": []
              },
              "desc": "<p>The high resolution millisecond timestamp at which the Node.js process was\ninitialized.</p>"
            },
            {
              "textRaw": "`v8Start` {number}",
              "type": "number",
              "name": "v8Start",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": []
              },
              "desc": "<p>The high resolution millisecond timestamp at which the V8 platform was\ninitialized.</p>"
            }
          ]
        },
        {
          "textRaw": "Class: `perf_hooks.PerformanceObserver`",
          "type": "class",
          "name": "perf_hooks.PerformanceObserver",
          "methods": [
            {
              "textRaw": "`performanceObserver.disconnect()`",
              "type": "method",
              "name": "disconnect",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Disconnects the <code>PerformanceObserver</code> instance from all notifications.</p>"
            },
            {
              "textRaw": "`performanceObserver.observe(options)`",
              "type": "method",
              "name": "observe",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "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 notification callback will be called using `setImmediate()` and multiple `PerformanceEntry` instance notifications will be buffered internally. If `false`, notifications will be immediate and synchronous. **Default:** `false`.",
                          "name": "buffered",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "If true, the notification callback will be called using `setImmediate()` and multiple `PerformanceEntry` instance notifications will be buffered internally. If `false`, notifications will be immediate and synchronous."
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Subscribes the <code>PerformanceObserver</code> instance to notifications of new\n<code>PerformanceEntry</code> instances identified by <code>options.entryTypes</code>.</p>\n<p>When <code>options.buffered</code> is <code>false</code>, the <code>callback</code> will be invoked once for\nevery <code>PerformanceEntry</code> instance:</p>\n<pre><code class=\"language-js\">const {\n  performance,\n  PerformanceObserver\n} = require('perf_hooks');\n\nconst obs = new PerformanceObserver((list, observer) => {\n  // Called three times synchronously. `list` contains one item.\n});\nobs.observe({ entryTypes: ['mark'] });\n\nfor (let n = 0; n &#x3C; 3; n++)\n  performance.mark(`test${n}`);\n</code></pre>\n<pre><code class=\"language-js\">const {\n  performance,\n  PerformanceObserver\n} = require('perf_hooks');\n\nconst obs = new PerformanceObserver((list, observer) => {\n  // Called once. `list` contains three items.\n});\nobs.observe({ entryTypes: ['mark'], buffered: true });\n\nfor (let n = 0; n &#x3C; 3; n++)\n  performance.mark(`test${n}`);\n</code></pre>"
            }
          ],
          "signatures": [
            {
              "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-js\">const {\n  performance,\n  PerformanceObserver\n} = require('perf_hooks');\n\nconst obs = new PerformanceObserver((list, observer) => {\n  console.log(list.getEntries());\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>"
            }
          ]
        },
        {
          "textRaw": "Class: `PerformanceObserverEntryList`",
          "type": "class",
          "name": "PerformanceObserverEntryList",
          "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()`",
              "type": "method",
              "name": "getEntries",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {PerformanceEntry[]}",
                    "name": "return",
                    "type": "PerformanceEntry[]"
                  },
                  "params": []
                }
              ],
              "desc": "<p>Returns a list of <code>PerformanceEntry</code> objects in chronological order\nwith respect to <code>performanceEntry.startTime</code>.</p>"
            },
            {
              "textRaw": "`performanceObserverEntryList.getEntriesByName(name[, type])`",
              "type": "method",
              "name": "getEntriesByName",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {PerformanceEntry[]}",
                    "name": "return",
                    "type": "PerformanceEntry[]"
                  },
                  "params": [
                    {
                      "textRaw": "`name` {string}",
                      "name": "name",
                      "type": "string"
                    },
                    {
                      "textRaw": "`type` {string}",
                      "name": "type",
                      "type": "string"
                    }
                  ]
                }
              ],
              "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": "`performanceObserverEntryList.getEntriesByType(type)`",
              "type": "method",
              "name": "getEntriesByType",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {PerformanceEntry[]}",
                    "name": "return",
                    "type": "PerformanceEntry[]"
                  },
                  "params": [
                    {
                      "textRaw": "`type` {string}",
                      "name": "type",
                      "type": "string"
                    }
                  ]
                }
              ],
              "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>"
            }
          ]
        }
      ],
      "methods": [
        {
          "textRaw": "`perf_hooks.monitorEventLoopDelay([options])`",
          "type": "method",
          "name": "monitorEventLoopDelay",
          "meta": {
            "added": [
              "v11.10.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "return": {
                "textRaw": "Returns: {Histogram}",
                "name": "return",
                "type": "Histogram"
              },
              "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."
                    }
                  ]
                }
              ]
            }
          ],
          "desc": "<p><em>This property is an extension by Node.js. It is not available in Web browsers.</em></p>\n<p>Creates a <code>Histogram</code> object that samples and reports the event loop delay\nover 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-js\">const { monitorEventLoopDelay } = require('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>",
          "classes": [
            {
              "textRaw": "Class: `Histogram`",
              "type": "class",
              "name": "Histogram",
              "meta": {
                "added": [
                  "v11.10.0"
                ],
                "changes": []
              },
              "desc": "<p>Tracks the event loop delay at a given sampling rate. The constructor of\nthis class not exposed to users.</p>\n<p><em>This property is an extension by Node.js. It is not available in Web browsers.</em></p>",
              "methods": [
                {
                  "textRaw": "`histogram.disable()`",
                  "type": "method",
                  "name": "disable",
                  "meta": {
                    "added": [
                      "v11.10.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "return": {
                        "textRaw": "Returns: {boolean}",
                        "name": "return",
                        "type": "boolean"
                      },
                      "params": []
                    }
                  ],
                  "desc": "<p>Disables the event loop delay sample timer. Returns <code>true</code> if the timer was\nstopped, <code>false</code> if it was already stopped.</p>"
                },
                {
                  "textRaw": "`histogram.enable()`",
                  "type": "method",
                  "name": "enable",
                  "meta": {
                    "added": [
                      "v11.10.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "return": {
                        "textRaw": "Returns: {boolean}",
                        "name": "return",
                        "type": "boolean"
                      },
                      "params": []
                    }
                  ],
                  "desc": "<p>Enables the event loop delay sample timer. Returns <code>true</code> if the timer was\nstarted, <code>false</code> if it was already started.</p>"
                },
                {
                  "textRaw": "`histogram.percentile(percentile)`",
                  "type": "method",
                  "name": "percentile",
                  "meta": {
                    "added": [
                      "v11.10.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "return": {
                        "textRaw": "Returns: {number}",
                        "name": "return",
                        "type": "number"
                      },
                      "params": [
                        {
                          "textRaw": "`percentile` {number} A percentile value between 1 and 100.",
                          "name": "percentile",
                          "type": "number",
                          "desc": "A percentile value between 1 and 100."
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Returns the value at the given percentile.</p>"
                },
                {
                  "textRaw": "`histogram.reset()`",
                  "type": "method",
                  "name": "reset",
                  "meta": {
                    "added": [
                      "v11.10.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": []
                    }
                  ],
                  "desc": "<p>Resets the collected histogram data.</p>"
                }
              ],
              "properties": [
                {
                  "textRaw": "`exceeds` {number}",
                  "type": "number",
                  "name": "exceeds",
                  "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": "`max` {number}",
                  "type": "number",
                  "name": "max",
                  "meta": {
                    "added": [
                      "v11.10.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The maximum recorded event loop delay.</p>"
                },
                {
                  "textRaw": "`mean` {number}",
                  "type": "number",
                  "name": "mean",
                  "meta": {
                    "added": [
                      "v11.10.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The mean of the recorded event loop delays.</p>"
                },
                {
                  "textRaw": "`min` {number}",
                  "type": "number",
                  "name": "min",
                  "meta": {
                    "added": [
                      "v11.10.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The minimum recorded event loop delay.</p>"
                },
                {
                  "textRaw": "`percentiles` {Map}",
                  "type": "Map",
                  "name": "percentiles",
                  "meta": {
                    "added": [
                      "v11.10.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>Returns a <code>Map</code> object detailing the accumulated percentile distribution.</p>"
                },
                {
                  "textRaw": "`stddev` {number}",
                  "type": "number",
                  "name": "stddev",
                  "meta": {
                    "added": [
                      "v11.10.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The standard deviation of the recorded event loop delays.</p>\n<h2>Examples</h2>"
                }
              ]
            }
          ],
          "modules": [
            {
              "textRaw": "Measuring the duration of async operations",
              "name": "measuring_the_duration_of_async_operations",
              "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-js\">'use strict';\nconst async_hooks = require('async_hooks');\nconst {\n  performance,\n  PerformanceObserver\n} = require('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  observer.disconnect();\n});\nobs.observe({ entryTypes: ['measure'], buffered: true });\n\nsetTimeout(() => {}, 1000);\n</code></pre>",
              "type": "module",
              "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",
              "desc": "<p>The following example measures the duration of <code>require()</code> operations to load\ndependencies:</p>\n<!-- eslint-disable no-global-assign -->\n<pre><code class=\"language-js\">'use strict';\nconst {\n  performance,\n  PerformanceObserver\n} = require('perf_hooks');\nconst mod = require('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  obs.disconnect();\n});\nobs.observe({ entryTypes: ['function'], buffered: true });\n\nrequire('some-module');\n</code></pre>",
              "type": "module",
              "displayName": "Measuring how long it takes to load dependencies"
            }
          ]
        }
      ],
      "type": "module",
      "displayName": "Performance measurement APIs"
    },
    {
      "textRaw": "Punycode",
      "name": "punycode",
      "meta": {
        "changes": [
          {
            "version": "v7.0.0",
            "pr-url": "https://github.com/nodejs/node/pull/7941",
            "description": "Accessing this module will now emit a deprecation warning."
          }
        ]
      },
      "introduced_in": "v0.10.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.</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('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)`",
          "type": "method",
          "name": "decode",
          "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)`",
          "type": "method",
          "name": "encode",
          "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)`",
          "type": "method",
          "name": "toASCII",
          "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)`",
          "type": "method",
          "name": "toUnicode",
          "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",
          "meta": {
            "added": [
              "v0.7.0"
            ],
            "changes": []
          },
          "methods": [
            {
              "textRaw": "`punycode.ucs2.decode(string)`",
              "type": "method",
              "name": "decode",
              "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)`",
              "type": "method",
              "name": "encode",
              "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": "`version` {string}",
          "type": "string",
          "name": "version",
          "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>"
        }
      ],
      "type": "module",
      "displayName": "Punycode"
    },
    {
      "textRaw": "Query string",
      "name": "querystring",
      "introduced_in": "v0.1.25",
      "stability": 2,
      "stabilityText": "Stable",
      "desc": "<p>The <code>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('querystring');\n</code></pre>",
      "methods": [
        {
          "textRaw": "`querystring.decode()`",
          "type": "method",
          "name": "decode",
          "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()`",
          "type": "method",
          "name": "encode",
          "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)`",
          "type": "method",
          "name": "escape",
          "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]]])`",
          "type": "method",
          "name": "parse",
          "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."
                },
                {
                  "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."
                },
                {
                  "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."
                    }
                  ]
                }
              ]
            }
          ],
          "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<!-- eslint-skip -->\n<pre><code class=\"language-js\">{\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]]])`",
          "type": "method",
          "name": "stringify",
          "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."
                },
                {
                  "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."
                },
                {
                  "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."
                    }
                  ]
                }
              ]
            }
          ],
          "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/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string&gt;</a> | <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;number&gt;</a> | <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type\" class=\"type\">&lt;boolean&gt;</a> | <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string[]&gt;</a> | <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;number[]&gt;</a> | <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type\" class=\"type\">&lt;boolean[]&gt;</a>\nAny other input values will be coerced to empty 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)`",
          "type": "method",
          "name": "unescape",
          "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>"
        }
      ],
      "type": "module",
      "displayName": "querystring"
    },
    {
      "textRaw": "Readline",
      "name": "readline",
      "introduced_in": "v0.10.0",
      "stability": 2,
      "stabilityText": "Stable",
      "desc": "<p>The <code>readline</code> module provides an interface for reading data from a <a href=\"stream.html#stream_readable_streams\">Readable</a>\nstream (such as <a href=\"process.html#process_process_stdin\"><code>process.stdin</code></a>) one line at a time. It can be accessed\nusing:</p>\n<pre><code class=\"language-js\">const readline = require('readline');\n</code></pre>\n<p>The following simple example illustrates the basic use of the <code>readline</code> module.</p>\n<pre><code class=\"language-js\">const readline = require('readline');\n\nconst rl = readline.createInterface({\n  input: process.stdin,\n  output: process.stdout\n});\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>",
      "classes": [
        {
          "textRaw": "Class: `Interface`",
          "type": "class",
          "name": "Interface",
          "meta": {
            "added": [
              "v0.1.104"
            ],
            "changes": []
          },
          "desc": "<ul>\n<li>Extends: <a href=\"events.html#events_class_eventemitter\" class=\"type\">&lt;EventEmitter&gt;</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#stream_readable_streams\">Readable</a> stream and a single <code>output</code> <a href=\"stream.html#stream_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'`",
              "type": "event",
              "name": "close",
              "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>readline.Interface</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 <code>&#x3C;ctrl>-D</code> to signal end-of-transmission (EOT);</li>\n<li>The <code>input</code> stream receives <code>&#x3C;ctrl>-C</code> to signal <code>SIGINT</code> and there is no\n<code>'SIGINT'</code> event listener registered on the <code>readline.Interface</code> instance.</li>\n</ul>\n<p>The listener function is called without passing any arguments.</p>\n<p>The <code>readline.Interface</code> instance is finished once the <code>'close'</code> event is\nemitted.</p>"
            },
            {
              "textRaw": "Event: `'line'`",
              "type": "event",
              "name": "line",
              "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 the <code>&#x3C;Enter></code>, or <code>&#x3C;Return></code> keys.</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: `'pause'`",
              "type": "event",
              "name": "pause",
              "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=\"readline.html#readline_event_sigtstp\"><code>'SIGTSTP'</code></a> and <a href=\"readline.html#readline_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'`",
              "type": "event",
              "name": "resume",
              "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'`",
              "type": "event",
              "name": "SIGCONT",
              "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 <code>&#x3C;ctrl>-Z</code> (i.e. <code>SIGTSTP</code>) is then brought back to the\nforeground 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'`",
              "type": "event",
              "name": "SIGINT",
              "meta": {
                "added": [
                  "v0.3.0"
                ],
                "changes": []
              },
              "params": [],
              "desc": "<p>The <code>'SIGINT'</code> event is emitted whenever the <code>input</code> stream receives a\n<code>&#x3C;ctrl>-C</code> input, known typically as <code>SIGINT</code>. If there are no <code>'SIGINT'</code> event\nlisteners registered when the <code>input</code> stream receives a <code>SIGINT</code>, the <code>'pause'</code>\nevent 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'`",
              "type": "event",
              "name": "SIGTSTP",
              "meta": {
                "added": [
                  "v0.7.5"
                ],
                "changes": []
              },
              "params": [],
              "desc": "<p>The <code>'SIGTSTP'</code> event is emitted when the <code>input</code> stream receives a <code>&#x3C;ctrl>-Z</code>\ninput, typically known as <code>SIGTSTP</code>. If there are no <code>'SIGTSTP'</code> event listeners\nregistered when the <code>input</code> stream receives a <code>SIGTSTP</code>, the Node.js process\nwill 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()`",
              "type": "method",
              "name": "close",
              "meta": {
                "added": [
                  "v0.1.98"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>The <code>rl.close()</code> method closes the <code>readline.Interface</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>readline.Interface</code> instance.</p>"
            },
            {
              "textRaw": "`rl.pause()`",
              "type": "method",
              "name": "pause",
              "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>readline.Interface</code> instance.</p>"
            },
            {
              "textRaw": "`rl.prompt([preserveCursor])`",
              "type": "method",
              "name": "prompt",
              "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`."
                    }
                  ]
                }
              ],
              "desc": "<p>The <code>rl.prompt()</code> method writes the <code>readline.Interface</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>readline.Interface</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.question(query, callback)`",
              "type": "method",
              "name": "question",
              "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": "`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>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>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>"
            },
            {
              "textRaw": "`rl.resume()`",
              "type": "method",
              "name": "resume",
              "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)`",
              "type": "method",
              "name": "setPrompt",
              "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.write(data[, key])`",
              "type": "method",
              "name": "write",
              "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 `<ctrl>` key.",
                          "name": "ctrl",
                          "type": "boolean",
                          "desc": "`true` to indicate the `<ctrl>` key."
                        },
                        {
                          "textRaw": "`meta` {boolean} `true` to indicate the `<Meta>` key.",
                          "name": "meta",
                          "type": "boolean",
                          "desc": "`true` to indicate the `<Meta>` key."
                        },
                        {
                          "textRaw": "`shift` {boolean} `true` to indicate the `<Shift>` key.",
                          "name": "shift",
                          "type": "boolean",
                          "desc": "`true` to indicate the `<Shift>` key."
                        },
                        {
                          "textRaw": "`name` {string} The name of the a key.",
                          "name": "name",
                          "type": "string",
                          "desc": "The name of the a key."
                        }
                      ]
                    }
                  ]
                }
              ],
              "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=\"readline.html#readline_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>readline.Interface</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]()`",
              "type": "method",
              "name": "[Symbol.asyncIterator]",
              "meta": {
                "added": [
                  "v11.4.0"
                ],
                "changes": [
                  {
                    "version": "v11.14.0",
                    "pr-url": "https://github.com/nodejs/node/pull/26989",
                    "description": "Symbol.asyncIterator support is no longer experimental."
                  }
                ]
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {AsyncIterator}",
                    "name": "return",
                    "type": "AsyncIterator"
                  },
                  "params": []
                }
              ],
              "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>readline.Interface</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=\"readline.html#readline_rl_close\"><code>rl.close()</code></a> will be called. In other words, iterating over a\n<code>readline.Interface</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>"
            },
            {
              "textRaw": "`rl.getCursorPos()`",
              "type": "method",
              "name": "getCursorPos",
              "meta": {
                "added": [
                  "v12.16.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "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"
                      }
                    ]
                  },
                  "params": []
                }
              ],
              "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": "`line` {string|undefined}",
              "type": "string|undefined",
              "name": "line",
              "meta": {
                "added": [
                  "v0.1.98"
                ],
                "changes": []
              },
              "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=\"readline.html#readline_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": "`cursor` {number|undefined}",
              "type": "number|undefined",
              "name": "cursor",
              "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>"
            }
          ]
        }
      ],
      "methods": [
        {
          "textRaw": "`readline.clearLine(stream, dir[, callback])`",
          "type": "method",
          "name": "clearLine",
          "meta": {
            "added": [
              "v0.7.7"
            ],
            "changes": [
              {
                "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": [
            {
              "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`."
              },
              "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."
                }
              ]
            }
          ],
          "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])`",
          "type": "method",
          "name": "clearScreenDown",
          "meta": {
            "added": [
              "v0.7.7"
            ],
            "changes": [
              {
                "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": [
            {
              "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`."
              },
              "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."
                }
              ]
            }
          ],
          "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)`",
          "type": "method",
          "name": "createInterface",
          "meta": {
            "added": [
              "v0.1.98"
            ],
            "changes": [
              {
                "version": "v8.3.0, 6.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": "`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": "`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": "`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": "`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)."
                    }
                  ]
                }
              ]
            }
          ],
          "desc": "<p>The <code>readline.createInterface()</code> method creates a new <code>readline.Interface</code>\ninstance.</p>\n<pre><code class=\"language-js\">const readline = require('readline');\nconst rl = readline.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#process_process_stdout\"><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",
              "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>",
              "type": "module",
              "displayName": "Use of the `completer` function"
            }
          ]
        },
        {
          "textRaw": "`readline.cursorTo(stream, x[, y][, callback])`",
          "type": "method",
          "name": "cursorTo",
          "meta": {
            "added": [
              "v0.7.7"
            ],
            "changes": [
              {
                "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": [
            {
              "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`."
              },
              "params": [
                {
                  "textRaw": "`stream` {stream.Writable}",
                  "name": "stream",
                  "type": "stream.Writable"
                },
                {
                  "textRaw": "`x` {number}",
                  "name": "x",
                  "type": "number"
                },
                {
                  "textRaw": "`y` {number}",
                  "name": "y",
                  "type": "number"
                },
                {
                  "textRaw": "`callback` {Function} Invoked once the operation completes.",
                  "name": "callback",
                  "type": "Function",
                  "desc": "Invoked once the operation completes."
                }
              ]
            }
          ],
          "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.emitKeypressEvents(stream[, interface])`",
          "type": "method",
          "name": "emitKeypressEvents",
          "meta": {
            "added": [
              "v0.7.7"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`stream` {stream.Readable}",
                  "name": "stream",
                  "type": "stream.Readable"
                },
                {
                  "textRaw": "`interface` {readline.Interface}",
                  "name": "interface",
                  "type": "readline.Interface"
                }
              ]
            }
          ],
          "desc": "<p>The <code>readline.emitKeypressEvents()</code> method causes the given <a href=\"stream.html#stream_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>"
        },
        {
          "textRaw": "`readline.moveCursor(stream, dx, dy[, callback])`",
          "type": "method",
          "name": "moveCursor",
          "meta": {
            "added": [
              "v0.7.7"
            ],
            "changes": [
              {
                "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": [
            {
              "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`."
              },
              "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."
                }
              ]
            }
          ],
          "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>\n<h2>Example: Tiny CLI</h2>\n<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-js\">const readline = require('readline');\nconst rl = readline.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>\n<h2>Example: Read file stream line-by-Line</h2>\n<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#fs_class_fs_readstream\"><code>fs.ReadStream</code></a> API as\nwell as a <code>for await...of</code> loop:</p>\n<pre><code class=\"language-js\">const fs = require('fs');\nconst readline = require('readline');\n\nasync function processLineByLine() {\n  const fileStream = fs.createReadStream('input.txt');\n\n  const rl = readline.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=\"readline.html#readline_event_line\"><code>'line'</code></a> event:</p>\n<pre><code class=\"language-js\">const fs = require('fs');\nconst readline = require('readline');\n\nconst rl = readline.createInterface({\n  input: fs.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-js\">const { once } = require('events');\nconst { createReadStream } = require('fs');\nconst { createInterface } = require('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>"
        }
      ],
      "modules": [
        {
          "textRaw": "TTY keybindings",
          "name": "tty_keybindings",
          "desc": "<table>\n  <tr>\n    <th>Keybindings</th>\n    <th>Description</th>\n    <th>Notes</th>\n  </tr>\n  <tr>\n    <td><code>ctrl</code> + <code>shift</code> + <code>backspace</code></td>\n    <td>Delete line left</td>\n    <td>Doesn't work on Linux, Mac and Windows</td>\n  </tr>\n  <tr>\n    <td><code>ctrl</code> + <code>shift</code> + <code>delete</code></td>\n    <td>Delete line right</td>\n    <td>Doesn't work on Mac</td>\n  </tr>\n  <tr>\n    <td><code>ctrl</code> + <code>c</code></td>\n    <td>Emit <code>SIGINT</code> or close the readline instance</td>\n    <td></td>\n  </tr>\n  <tr>\n    <td><code>ctrl</code> + <code>h</code></td>\n    <td>Delete left</td>\n    <td></td>\n  </tr>\n  <tr>\n    <td><code>ctrl</code> + <code>d</code></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><code>ctrl</code> + <code>u</code></td>\n    <td>Delete from the current position to the line start</td>\n    <td></td>\n  </tr>\n  <tr>\n    <td><code>ctrl</code> + <code>k</code></td>\n    <td>Delete from the current position to the end of line</td>\n    <td></td>\n  </tr>\n  <tr>\n    <td><code>ctrl</code> + <code>a</code></td>\n    <td>Go to start of line</td>\n    <td></td>\n  </tr>\n  <tr>\n    <td><code>ctrl</code> + <code>e</code></td>\n    <td>Go to to end of line</td>\n    <td></td>\n  </tr>\n  <tr>\n    <td><code>ctrl</code> + <code>b</code></td>\n    <td>Back one character</td>\n    <td></td>\n  </tr>\n  <tr>\n    <td><code>ctrl</code> + <code>f</code></td>\n    <td>Forward one character</td>\n    <td></td>\n  </tr>\n  <tr>\n    <td><code>ctrl</code> + <code>l</code></td>\n    <td>Clear screen</td>\n    <td></td>\n  </tr>\n  <tr>\n    <td><code>ctrl</code> + <code>n</code></td>\n    <td>Next history item</td>\n    <td></td>\n  </tr>\n  <tr>\n    <td><code>ctrl</code> + <code>p</code></td>\n    <td>Previous history item</td>\n    <td></td>\n  </tr>\n  <tr>\n    <td><code>ctrl</code> + <code>z</code></td>\n    <td>Moves running process into background. Type\n    <code>fg</code> and press <code>enter</code>\n    to return.</td>\n    <td>Doesn't work on Windows</td>\n  </tr>\n  <tr>\n    <td><code>ctrl</code> + <code>w</code> or <code>ctrl</code>\n    + <code>backspace</code></td>\n    <td>Delete backwards to a word boundary</td>\n    <td><code>ctrl</code> + <code>backspace</code> Doesn't\n    work on Linux, Mac and Windows</td>\n  </tr>\n  <tr>\n    <td><code>ctrl</code> + <code>delete</code></td>\n    <td>Delete forward to a word boundary</td>\n    <td>Doesn't work on Mac</td>\n  </tr>\n  <tr>\n    <td><code>ctrl</code> + <code>left</code> or\n    <code>meta</code> + <code>b</code></td>\n    <td>Word left</td>\n    <td><code>ctrl</code> + <code>left</code> Doesn't work\n    on Mac</td>\n  </tr>\n  <tr>\n    <td><code>ctrl</code> + <code>right</code> or\n    <code>meta</code> + <code>f</code></td>\n    <td>Word right</td>\n    <td><code>ctrl</code> + <code>right</code> Doesn't work\n    on Mac</td>\n  </tr>\n  <tr>\n    <td><code>meta</code> + <code>d</code> or <code>meta</code>\n    + <code>delete</code></td>\n    <td>Delete word right</td>\n    <td><code>meta</code> + <code>delete</code> Doesn't work\n    on windows</td>\n  </tr>\n  <tr>\n    <td><code>meta</code> + <code>backspace</code></td>\n    <td>Delete word left</td>\n    <td>Doesn't work on Mac</td>\n  </tr>\n</table>",
          "type": "module",
          "displayName": "TTY keybindings"
        }
      ],
      "type": "module",
      "displayName": "Readline"
    },
    {
      "textRaw": "REPL",
      "name": "repl",
      "introduced_in": "v0.10.0",
      "stability": 2,
      "stabilityText": "Stable",
      "desc": "<p>The <code>repl</code> module provides a Read-Eval-Print-Loop (REPL) implementation that\nis available both as a standalone program or includible in other applications.\nIt can be accessed using:</p>\n<pre><code class=\"language-js\">const repl = require('repl');\n</code></pre>",
      "modules": [
        {
          "textRaw": "Design and features",
          "name": "design_and_features",
          "desc": "<p>The <code>repl</code> module exports the <a href=\"repl.html#repl_class_replserver\"><code>repl.REPLServer</code></a> class. While running,\ninstances of <a href=\"repl.html#repl_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=\"repl.html#repl_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",
              "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, entering\nthe <code>.break</code> command (or pressing the <code>&#x3C;ctrl>-C</code> key combination) will 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 (<code>&#x3C;ctrl>-D</code> to finish, <code>&#x3C;ctrl>-C</code> 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><code>&#x3C;ctrl>-C</code>: When pressed once, has the same effect as the <code>.break</code> command.\nWhen pressed twice on a blank line, has the same effect as the <code>.exit</code>\ncommand.</li>\n<li><code>&#x3C;ctrl>-D</code>: Has the same effect as the <code>.exit</code> command.</li>\n<li><code>&#x3C;tab></code>: When pressed on a blank line, displays global and local (scope)\nvariables. 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=\"repl.html#repl_reverse_i_search\"><code>reverse-i-search</code></a>.\nFor all other key bindings, see <a href=\"readline.html#readline_tty_keybindings\">TTY keybindings</a>.</p>",
              "type": "module",
              "displayName": "Commands and special keys"
            },
            {
              "textRaw": "Default evaluation",
              "name": "default_evaluation",
              "desc": "<p>By default, all instances of <a href=\"repl.html#repl_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=\"repl.html#repl_class_replserver\"><code>repl.REPLServer</code></a> instance is created.</p>",
              "modules": [
                {
                  "textRaw": "JavaScript expressions",
                  "name": "javascript_expressions",
                  "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>",
                  "type": "module",
                  "displayName": "JavaScript expressions"
                },
                {
                  "textRaw": "Global and local scope",
                  "name": "global_and_local_scope",
                  "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-js\">const repl = require('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-js\">const repl = require('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>",
                  "type": "module",
                  "displayName": "Global and local scope"
                },
                {
                  "textRaw": "Accessing core Node.js modules",
                  "name": "accessing_core_node.js_modules",
                  "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('fs')</code>.</p>\n<pre><code class=\"language-console\">> fs.createReadStream('./some/file');\n</code></pre>",
                  "type": "module",
                  "displayName": "Accessing core Node.js modules"
                },
                {
                  "textRaw": "Global uncaught exceptions",
                  "name": "global_uncaught_exceptions",
                  "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>Uncaught exceptions only emit the <a href=\"process.html#process_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 throws <a href=\"errors.html#errors_err_invalid_repl_input\"><code>ERR_INVALID_REPL_INPUT</code></a>.</li>\n<li>Trying to use <a href=\"process.html#process_process_setuncaughtexceptioncapturecallback_fn\"><code>process.setUncaughtExceptionCaptureCallback()</code></a> throws\nan <a href=\"errors.html#errors_err_domain_cannot_set_uncaught_exception_capture\"><code>ERR_DOMAIN_CANNOT_SET_UNCAUGHT_EXCEPTION_CAPTURE</code></a> error.</li>\n</ul>\n<p>As standalone program:</p>\n<pre><code class=\"language-js\">process.on('uncaughtException', () => console.log('Uncaught'));\n\nthrow new Error('foobar');\n// Uncaught\n</code></pre>\n<p>When used in another application:</p>\n<pre><code class=\"language-js\">process.on('uncaughtException', () => console.log('Uncaught'));\n// TypeError [ERR_INVALID_REPL_INPUT]: Listeners for `uncaughtException`\n// cannot be used in the REPL\n\nthrow new Error('foobar');\n// Thrown:\n// Error: foobar\n</code></pre>",
                  "type": "module",
                  "displayName": "Global uncaught exceptions"
                },
                {
                  "textRaw": "Assignment of the `_` (underscore) variable",
                  "name": "assignment_of_the_`_`_(underscore)_variable",
                  "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');\nError: foo\n> _error.message\n'foo'\n</code></pre>",
                  "type": "module",
                  "displayName": "Assignment of the `_` (underscore) variable"
                },
                {
                  "textRaw": "`await` keyword",
                  "name": "`await`_keyword",
                  "desc": "<p>With the <a href=\"cli.html#cli_experimental_repl_await\"><code>--experimental-repl-await</code></a> command line option specified,\nexperimental support for the <code>await</code> keyword is enabled.</p>\n<pre><code class=\"language-console\">> await Promise.resolve(123)\n123\n> await Promise.reject(new Error('REPL await'))\nError: REPL await\n    at repl:1:45\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>",
                  "type": "module",
                  "displayName": "`await` keyword"
                }
              ],
              "type": "module",
              "displayName": "Default evaluation"
            },
            {
              "textRaw": "Reverse-i-search",
              "name": "reverse-i-search",
              "meta": {
                "added": [
                  "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 <code>&#x3C;ctrl> + R</code> to search backwards and <code>&#x3C;ctrl> + S</code> to search\nforwards.</p>\n<p>Duplicated history entires will be skipped.</p>\n<p>Entries are accepted as soon as any button is pressed that doesn't correspond\nwith the reverse search. Cancelling is possible by pressing <code>escape</code> or\n<code>&#x3C;ctrl> + C</code>.</p>\n<p>Changing the direction immediately searches for the next entry in the expected\ndirection from the current position on.</p>",
              "type": "module",
              "displayName": "Reverse-i-search"
            },
            {
              "textRaw": "Custom evaluation functions",
              "name": "custom_evaluation_functions",
              "desc": "<p>When a new <a href=\"repl.html#repl_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>The following illustrates a hypothetical example of a REPL that performs\ntranslation of text from one language to another:</p>\n<pre><code class=\"language-js\">const repl = require('repl');\nconst { Translator } = require('translator');\n\nconst myTranslator = new Translator('en', 'fr');\n\nfunction myEval(cmd, context, filename, callback) {\n  callback(null, myTranslator.translate(cmd));\n}\n\nrepl.start({ prompt: '> ', eval: myEval });\n</code></pre>",
              "modules": [
                {
                  "textRaw": "Recoverable errors",
                  "name": "recoverable_errors",
                  "desc": "<p>As a user is typing input into the REPL prompt, pressing the <code>&#x3C;enter></code> key will\nsend the current line of input to the <code>eval</code> function. In order to support\nmulti-line input, the eval function can return an instance of <code>repl.Recoverable</code>\nto 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>",
                  "type": "module",
                  "displayName": "Recoverable errors"
                }
              ],
              "type": "module",
              "displayName": "Custom evaluation functions"
            },
            {
              "textRaw": "Customizing REPL output",
              "name": "customizing_repl_output",
              "desc": "<p>By default, <a href=\"repl.html#repl_class_replserver\"><code>repl.REPLServer</code></a> instances format output using the\n<a href=\"util.html#util_util_inspect_object_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#util_util_inspect_object_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#util_util_inspect_object_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=\"repl.html#repl_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-js\">const repl = require('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>",
              "type": "module",
              "displayName": "Customizing REPL output"
            }
          ],
          "type": "module",
          "displayName": "Design and features"
        },
        {
          "textRaw": "The Node.js REPL",
          "name": "the_node.js_repl",
          "desc": "<p>Node.js itself uses the <code>repl</code> module to provide its own interactive interface\nfor executing JavaScript. This can be used by executing the Node.js binary\nwithout 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",
              "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>",
              "type": "module",
              "displayName": "Environment variable options"
            },
            {
              "textRaw": "Persistent history",
              "name": "persistent_history",
              "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>",
              "type": "module",
              "displayName": "Persistent history"
            },
            {
              "textRaw": "Using the Node.js REPL with advanced line-editors",
              "name": "using_the_node.js_repl_with_advanced_line-editors",
              "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-text\">alias node=\"env NODE_NO_READLINE=1 rlwrap node\"\n</code></pre>",
              "type": "module",
              "displayName": "Using the Node.js REPL with advanced line-editors"
            },
            {
              "textRaw": "Starting multiple REPL instances against a single running instance",
              "name": "starting_multiple_repl_instances_against_a_single_running_instance",
              "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 but have\nseparate 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:</p>\n<pre><code class=\"language-js\">const net = require('net');\nconst repl = require('repl');\nlet connections = 0;\n\nrepl.start({\n  prompt: 'Node.js via stdin> ',\n  input: process.stdin,\n  output: process.stdout\n});\n\nnet.createServer((socket) => {\n  connections += 1;\n  repl.start({\n    prompt: 'Node.js via Unix socket> ',\n    input: socket,\n    output: socket\n  }).on('exit', () => {\n    socket.end();\n  });\n}).listen('/tmp/node-repl-sock');\n\nnet.createServer((socket) => {\n  connections += 1;\n  repl.start({\n    prompt: 'Node.js via TCP socket> ',\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>\n<p>For an example of running a \"full-featured\" (<code>terminal</code>) REPL over\na <code>net.Server</code> and <code>net.Socket</code> instance, see:\n<a href=\"https://gist.github.com/TooTallNate/2209310\">https://gist.github.com/TooTallNate/2209310</a>.</p>\n<p>For an example of running a REPL instance over <a href=\"https://curl.haxx.se/docs/manpage.html\"><a href=\"https://curl.haxx.se/docs/manpage.html\"><code>curl(1)</code></a></a>, see:\n<a href=\"https://gist.github.com/TooTallNate/2053342\">https://gist.github.com/TooTallNate/2053342</a>.</p>",
              "type": "module",
              "displayName": "Starting multiple REPL instances against a single running instance"
            }
          ],
          "type": "module",
          "displayName": "The Node.js REPL"
        }
      ],
      "classes": [
        {
          "textRaw": "Class: `REPLServer`",
          "type": "class",
          "name": "REPLServer",
          "meta": {
            "added": [
              "v0.1.91"
            ],
            "changes": []
          },
          "desc": "<ul>\n<li><code>options</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object\" class=\"type\">&lt;Object&gt;</a> | <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string&gt;</a> See <a href=\"repl.html#repl_repl_start_options\"><code>repl.start()</code></a></li>\n<li>Extends: <a href=\"readline.html#readline_class_interface\" class=\"type\">&lt;readline.Interface&gt;</a></li>\n</ul>\n<p>Instances of <code>repl.REPLServer</code> are created using the <a href=\"repl.html#repl_repl_start_options\"><code>repl.start()</code></a> method\nor directly using the JavaScript <code>new</code> keyword.</p>\n<pre><code class=\"language-js\">const repl = require('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'`",
              "type": "event",
              "name": "exit",
              "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 <code>&#x3C;ctrl>-C</code> twice to signal <code>SIGINT</code>,\nor by pressing <code>&#x3C;ctrl>-D</code> to signal <code>'end'</code> on the input stream. 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'`",
              "type": "event",
              "name": "reset",
              "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-js\">const repl = require('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)`",
              "type": "method",
              "name": "defineCommand",
              "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/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string&gt;</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/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function\" class=\"type\">&lt;Function&gt;</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-js\">const repl = require('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])`",
              "type": "method",
              "name": "displayPrompt",
              "meta": {
                "added": [
                  "v0.1.91"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`preserveCursor` {boolean}",
                      "name": "preserveCursor",
                      "type": "boolean"
                    }
                  ]
                }
              ],
              "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, an ellipsis 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()`",
              "type": "method",
              "name": "clearBufferedCommand",
              "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.parseREPLKeyword(keyword[, rest])`",
              "type": "method",
              "name": "parseREPLKeyword",
              "meta": {
                "added": [
                  "v0.8.9"
                ],
                "deprecated": [
                  "v9.0.0"
                ],
                "changes": []
              },
              "stability": 0,
              "stabilityText": "Deprecated.",
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  },
                  "params": [
                    {
                      "textRaw": "`keyword` {string} the potential keyword to parse and execute",
                      "name": "keyword",
                      "type": "string",
                      "desc": "the potential keyword to parse and execute"
                    },
                    {
                      "textRaw": "`rest` {any} any parameters to the keyword command",
                      "name": "rest",
                      "type": "any",
                      "desc": "any parameters to the keyword command"
                    }
                  ]
                }
              ],
              "desc": "<p>An internal method used to parse and execute <code>REPLServer</code> keywords.\nReturns <code>true</code> if <code>keyword</code> is a valid keyword, otherwise <code>false</code>.</p>"
            },
            {
              "textRaw": "`replServer.setupHistory(historyPath, callback)`",
              "type": "method",
              "name": "setupHistory",
              "meta": {
                "added": [
                  "v11.10.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`historyPath` {string} the path to the history file",
                      "name": "historyPath",
                      "type": "string",
                      "desc": "the path to the history file"
                    },
                    {
                      "textRaw": "`callback` {Function} called when history writes are ready or upon error",
                      "name": "callback",
                      "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"
                        }
                      ]
                    }
                  ]
                }
              ],
              "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>"
            }
          ]
        }
      ],
      "methods": [
        {
          "textRaw": "`repl.start([options])`",
          "type": "method",
          "name": "start",
          "meta": {
            "added": [
              "v0.1.91"
            ],
            "changes": [
              {
                "version": "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": "v5.8.0",
                "pr-url": "https://github.com/nodejs/node/pull/5388",
                "description": "The `options` parameter is optional now."
              }
            ]
          },
          "signatures": [
            {
              "return": {
                "textRaw": "Returns: {repl.REPLServer}",
                "name": "return",
                "type": "repl.REPLServer"
              },
              "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.",
                      "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",
                      "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 `Ctrl+C` 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 `Ctrl+C` 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."
                    }
                  ]
                }
              ]
            }
          ],
          "desc": "<p>The <code>repl.start()</code> method creates and starts a <a href=\"repl.html#repl_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-js\">const repl = require('repl');\n\n// a Unix style prompt\nrepl.start('$ ');\n</code></pre>"
        }
      ],
      "type": "module",
      "displayName": "REPL"
    },
    {
      "textRaw": "Stream",
      "name": "stream",
      "introduced_in": "v0.10.0",
      "stability": 2,
      "stabilityText": "Stable",
      "desc": "<p>A stream is an abstract interface for working with streaming data in Node.js.\nThe <code>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#http_class_http_incomingmessage\">request to an HTTP server</a> and <a href=\"process.html#process_process_stdout\"><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#events_class_eventemitter\"><code>EventEmitter</code></a>.</p>\n<p>To access the <code>stream</code> module:</p>\n<pre><code class=\"language-js\">const stream = require('stream');\n</code></pre>\n<p>The <code>stream</code> module is useful for creating new types of stream instances. It is\nusually not necessary to use the <code>stream</code> module to consume streams.</p>",
      "modules": [
        {
          "textRaw": "Organization of this document",
          "name": "organization_of_this_document",
          "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>",
          "type": "module",
          "displayName": "Organization of this document"
        },
        {
          "textRaw": "Types of streams",
          "name": "types_of_streams",
          "desc": "<p>There are four fundamental stream types within Node.js:</p>\n<ul>\n<li><a href=\"stream.html#stream_class_stream_writable\"><code>Writable</code></a>: streams to which data can be written (for example,\n<a href=\"fs.html#fs_fs_createwritestream_path_options\"><code>fs.createWriteStream()</code></a>).</li>\n<li><a href=\"stream.html#stream_class_stream_readable\"><code>Readable</code></a>: streams from which data can be read (for example,\n<a href=\"fs.html#fs_fs_createreadstream_path_options\"><code>fs.createReadStream()</code></a>).</li>\n<li><a href=\"stream.html#stream_class_stream_duplex\"><code>Duplex</code></a>: streams that are both <code>Readable</code> and <code>Writable</code> (for example,\n<a href=\"net.html#net_class_net_socket\"><code>net.Socket</code></a>).</li>\n<li><a href=\"stream.html#stream_class_stream_transform\"><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#zlib_zlib_createdeflate_options\"><code>zlib.createDeflate()</code></a>).</li>\n</ul>\n<p>Additionally, this module includes the utility functions\n<a href=\"stream.html#stream_stream_pipeline_streams_callback\"><code>stream.pipeline()</code></a>, <a href=\"stream.html#stream_stream_finished_stream_options_callback\"><code>stream.finished()</code></a> and\n<a href=\"stream.html#stream_stream_readable_from_iterable_options\"><code>stream.Readable.from()</code></a>.</p>",
          "modules": [
            {
              "textRaw": "Object mode",
              "name": "object_mode",
              "desc": "<p>All streams created by Node.js APIs operate exclusively on strings and <code>Buffer</code>\n(or <code>Uint8Array</code>) objects. It is possible, however, for stream implementations\nto work with other types of JavaScript values (with the exception of <code>null</code>,\nwhich serves a special purpose within streams). Such streams are considered to\noperate 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>",
              "type": "module",
              "displayName": "Object mode"
            }
          ],
          "miscs": [
            {
              "textRaw": "Buffering",
              "name": "Buffering",
              "type": "misc",
              "desc": "<p>Both <a href=\"stream.html#stream_class_stream_writable\"><code>Writable</code></a> and <a href=\"stream.html#stream_class_stream_readable\"><code>Readable</code></a> streams will store data in an internal\nbuffer that can be retrieved using <code>writable.writableBuffer</code> or\n<code>readable.readableBuffer</code>, respectively.</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=\"stream.html#stream_highwatermark_discrepancy_after_calling_readable_setencoding\">total number of bytes</a>. For streams operating\nin object mode, the <code>highWaterMark</code> specifies a total number of objects.</p>\n<p>Data is buffered in <code>Readable</code> streams when the implementation calls\n<a href=\"stream.html#stream_readable_push_chunk_encoding\"><code>stream.push(chunk)</code></a>. If the consumer of the Stream does not\ncall <a href=\"stream.html#stream_readable_read_size\"><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=\"stream.html#stream_readable_read_size_1\"><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=\"stream.html#stream_writable_write_chunk_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=\"stream.html#stream_readable_pipe_destination_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=\"stream.html#stream_class_stream_duplex\"><code>Duplex</code></a> and <a href=\"stream.html#stream_class_stream_transform\"><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#net_class_net_socket\"><code>net.Socket</code></a> instances are <a href=\"stream.html#stream_class_stream_duplex\"><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>"
            }
          ],
          "type": "module",
          "displayName": "Types of streams"
        }
      ],
      "methods": [
        {
          "textRaw": "`stream.finished(stream[, options], callback)`",
          "type": "method",
          "name": "finished",
          "meta": {
            "added": [
              "v10.0.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "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."
              },
              "params": [
                {
                  "textRaw": "`stream` {Stream} A readable and/or writable stream.",
                  "name": "stream",
                  "type": "Stream",
                  "desc": "A readable and/or writable stream."
                },
                {
                  "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",
                      "desc": "If set to `false`, then a call to `emit('error', err)` is not treated as finished. **Default**: `true`."
                    },
                    {
                      "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",
                      "desc": "When set to `false`, the callback will be called when the stream ends even though the stream might still be readable. **Default**: `true`."
                    },
                    {
                      "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",
                      "desc": "When set to `false`, the callback will be called when the stream ends even though the stream might still be writable. **Default**: `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."
                }
              ]
            }
          ],
          "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('stream');\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 is promisify-able as well;</p>\n<pre><code class=\"language-js\">const finished = util.promisify(stream.finished);\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<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(...streams, callback)`",
          "type": "method",
          "name": "pipeline",
          "meta": {
            "added": [
              "v10.0.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`...streams` {Stream} Two or more streams to pipe between.",
                  "name": "...streams",
                  "type": "Stream",
                  "desc": "Two or more streams to pipe between."
                },
                {
                  "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"
                    }
                  ]
                }
              ]
            }
          ],
          "desc": "<p>A module method to pipe between streams forwarding errors and properly cleaning\nup and provide a callback when the pipeline is complete.</p>\n<pre><code class=\"language-js\">const { pipeline } = require('stream');\nconst fs = require('fs');\nconst zlib = require('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 is promisify-able as well:</p>\n<pre><code class=\"language-js\">const pipeline = util.promisify(stream.pipeline);\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<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.</p>"
        },
        {
          "textRaw": "`stream.Readable.from(iterable, [options])`",
          "type": "method",
          "name": "from",
          "meta": {
            "added": [
              "v12.3.0",
              "v10.17.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "return": {
                "textRaw": "Returns: {stream.Readable}",
                "name": "return",
                "type": "stream.Readable"
              },
              "params": [
                {
                  "textRaw": "`iterable` {Iterable} Object implementing the `Symbol.asyncIterator` or `Symbol.iterator` iterable protocol. Emits an 'error' event if a null value is passed.",
                  "name": "iterable",
                  "type": "Iterable",
                  "desc": "Object implementing the `Symbol.asyncIterator` or `Symbol.iterator` iterable protocol. Emits an 'error' event if a null value is passed."
                },
                {
                  "textRaw": "`options` {Object} Options provided to `new stream.Readable([options])`. By default, `Readable.from()` will set `options.objectMode` to `true`, unless this is explicitly opted out by setting `options.objectMode` to `false`.",
                  "name": "options",
                  "type": "Object",
                  "desc": "Options provided to `new stream.Readable([options])`. By default, `Readable.from()` will set `options.objectMode` to `true`, unless this is explicitly opted out by setting `options.objectMode` to `false`."
                }
              ]
            }
          ],
          "desc": "<p>A utility method for creating readable streams out of iterators.</p>\n<pre><code class=\"language-js\">const { Readable } = require('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>"
        },
        {
          "textRaw": "`readable.read(0)`",
          "type": "method",
          "name": "read",
          "signatures": [
            {
              "params": []
            }
          ],
          "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=\"stream.html#stream_readable_read_size_1\"><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('')`",
          "type": "method",
          "name": "push",
          "signatures": [
            {
              "params": []
            }
          ],
          "desc": "<p>Use of <code>readable.push('')</code> is not recommended.</p>\n<p>Pushing a zero-byte string, <code>Buffer</code> or <code>Uint8Array</code> to a stream that is not in\nobject mode has an interesting side effect. Because it <em>is</em> a call to\n<a href=\"stream.html#stream_readable_push_chunk_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>"
        }
      ],
      "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('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 in JSON at position 1\n</code></pre>\n<p><a href=\"stream.html#stream_class_stream_writable\"><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=\"stream.html#stream_class_stream_readable\"><code>Readable</code></a> streams use the <a href=\"events.html#events_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=\"stream.html#stream_class_stream_writable\"><code>Writable</code></a> and <a href=\"stream.html#stream_class_stream_readable\"><code>Readable</code></a> streams use the <a href=\"events.html#events_class_eventemitter\"><code>EventEmitter</code></a> API in\nvarious ways to communicate the current state of the stream.</p>\n<p><a href=\"stream.html#stream_class_stream_duplex\"><code>Duplex</code></a> and <a href=\"stream.html#stream_class_stream_transform\"><code>Transform</code></a> streams are both <a href=\"stream.html#stream_class_stream_writable\"><code>Writable</code></a> and\n<a href=\"stream.html#stream_class_stream_readable\"><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('stream')</code>.</p>\n<p>Developers wishing to implement new types of streams should refer to the\nsection <a href=\"stream.html#stream_api_for_stream_implementers\">API for stream implementers</a>.</p>",
          "miscs": [
            {
              "textRaw": "Writable streams",
              "name": "writable_streams",
              "desc": "<p>Writable streams are an abstraction for a <em>destination</em> to which data is\nwritten.</p>\n<p>Examples of <a href=\"stream.html#stream_class_stream_writable\"><code>Writable</code></a> streams include:</p>\n<ul>\n<li><a href=\"http.html#http_class_http_clientrequest\">HTTP requests, on the client</a></li>\n<li><a href=\"http.html#http_class_http_serverresponse\">HTTP responses, on the server</a></li>\n<li><a href=\"fs.html#fs_class_fs_writestream\">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#net_class_net_socket\">TCP sockets</a></li>\n<li><a href=\"child_process.html#child_process_subprocess_stdin\">child process stdin</a></li>\n<li><a href=\"process.html#process_process_stdout\"><code>process.stdout</code></a>, <a href=\"process.html#process_process_stderr\"><code>process.stderr</code></a></li>\n</ul>\n<p>Some of these examples are actually <a href=\"stream.html#stream_class_stream_duplex\"><code>Duplex</code></a> streams that implement the\n<a href=\"stream.html#stream_class_stream_writable\"><code>Writable</code></a> interface.</p>\n<p>All <a href=\"stream.html#stream_class_stream_writable\"><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=\"stream.html#stream_class_stream_writable\"><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`",
                  "type": "class",
                  "name": "stream.Writable",
                  "meta": {
                    "added": [
                      "v0.9.4"
                    ],
                    "changes": []
                  },
                  "events": [
                    {
                      "textRaw": "Event: `'close'`",
                      "type": "event",
                      "name": "close",
                      "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=\"stream.html#stream_class_stream_writable\"><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'`",
                      "type": "event",
                      "name": "drain",
                      "meta": {
                        "added": [
                          "v0.9.4"
                        ],
                        "changes": []
                      },
                      "params": [],
                      "desc": "<p>If a call to <a href=\"stream.html#stream_writable_write_chunk_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'`",
                      "type": "event",
                      "name": "error",
                      "meta": {
                        "added": [
                          "v0.9.4"
                        ],
                        "changes": []
                      },
                      "params": [
                        {
                          "textRaw": "{Error}",
                          "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 not closed when the <code>'error'</code> event is emitted unless the\n<a href=\"stream.html#stream_constructor_new_stream_writable_options\"><code>autoDestroy</code></a> option was set to <code>true</code> when creating the\nstream.</p>"
                    },
                    {
                      "textRaw": "Event: `'finish'`",
                      "type": "event",
                      "name": "finish",
                      "meta": {
                        "added": [
                          "v0.9.4"
                        ],
                        "changes": []
                      },
                      "params": [],
                      "desc": "<p>The <code>'finish'</code> event is emitted after the <a href=\"stream.html#stream_writable_end_chunk_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'`",
                      "type": "event",
                      "name": "pipe",
                      "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=\"stream.html#stream_readable_pipe_destination_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'`",
                      "type": "event",
                      "name": "unpipe",
                      "meta": {
                        "added": [
                          "v0.9.4"
                        ],
                        "changes": []
                      },
                      "params": [
                        {
                          "textRaw": "`src` {stream.Readable} The source stream that [unpiped][`stream.unpipe()`] this writable",
                          "name": "src",
                          "type": "stream.Readable",
                          "desc": "The source stream that [unpiped][`stream.unpipe()`] this writable"
                        }
                      ],
                      "desc": "<p>The <code>'unpipe'</code> event is emitted when the <a href=\"stream.html#stream_readable_unpipe_destination\"><code>stream.unpipe()</code></a> method is called\non a <a href=\"stream.html#stream_class_stream_readable\"><code>Readable</code></a> stream, removing this <a href=\"stream.html#stream_class_stream_writable\"><code>Writable</code></a> from its set of\ndestinations.</p>\n<p>This is also emitted in case this <a href=\"stream.html#stream_class_stream_writable\"><code>Writable</code></a> stream emits an error when a\n<a href=\"stream.html#stream_class_stream_readable\"><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()`",
                      "type": "method",
                      "name": "cork",
                      "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=\"stream.html#stream_writable_uncork\"><code>stream.uncork()</code></a> or\n<a href=\"stream.html#stream_writable_end_chunk_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=\"stream.html#stream_writable_uncork\"><code>writable.uncork()</code></a>, <a href=\"stream.html#stream_writable_writev_chunks_callback\"><code>writable._writev()</code></a>.</p>"
                    },
                    {
                      "textRaw": "`writable.destroy([error])`",
                      "type": "method",
                      "name": "destroy",
                      "meta": {
                        "added": [
                          "v8.0.0"
                        ],
                        "changes": []
                      },
                      "signatures": [
                        {
                          "return": {
                            "textRaw": "Returns: {this}",
                            "name": "return",
                            "type": "this"
                          },
                          "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."
                            }
                          ]
                        }
                      ],
                      "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.\nImplementors should not override this method,\nbut instead implement <a href=\"stream.html#stream_writable_destroy_err_callback\"><code>writable._destroy()</code></a>.</p>"
                    },
                    {
                      "textRaw": "`writable.end([chunk[, encoding]][, callback])`",
                      "type": "method",
                      "name": "end",
                      "meta": {
                        "added": [
                          "v0.9.4"
                        ],
                        "changes": [
                          {
                            "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": [
                        {
                          "return": {
                            "textRaw": "Returns: {this}",
                            "name": "return",
                            "type": "this"
                          },
                          "params": [
                            {
                              "textRaw": "`chunk` {string|Buffer|Uint8Array|any} Optional data to write. For streams not operating in object mode, `chunk` must be a string, `Buffer` or `Uint8Array`. For object mode streams, `chunk` may be any JavaScript value other than `null`.",
                              "name": "chunk",
                              "type": "string|Buffer|Uint8Array|any",
                              "desc": "Optional data to write. For streams not operating in object mode, `chunk` must be a string, `Buffer` or `Uint8Array`. For object mode streams, `chunk` may be any JavaScript value other than `null`."
                            },
                            {
                              "textRaw": "`encoding` {string} The encoding if `chunk` is a string",
                              "name": "encoding",
                              "type": "string",
                              "desc": "The encoding if `chunk` is a string"
                            },
                            {
                              "textRaw": "`callback` {Function} Optional callback for when the stream is finished",
                              "name": "callback",
                              "type": "Function",
                              "desc": "Optional callback for when the stream is finished"
                            }
                          ]
                        }
                      ],
                      "desc": "<p>Calling the <code>writable.end()</code> method signals that no more data will be written\nto the <a href=\"stream.html#stream_class_stream_writable\"><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. If provided, the optional <code>callback</code> function is attached as a listener\nfor the <a href=\"stream.html#stream_event_finish\"><code>'finish'</code></a> event.</p>\n<p>Calling the <a href=\"stream.html#stream_writable_write_chunk_encoding_callback\"><code>stream.write()</code></a> method after calling\n<a href=\"stream.html#stream_writable_end_chunk_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('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)`",
                      "type": "method",
                      "name": "setDefaultEncoding",
                      "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": [
                        {
                          "return": {
                            "textRaw": "Returns: {this}",
                            "name": "return",
                            "type": "this"
                          },
                          "params": [
                            {
                              "textRaw": "`encoding` {string} The new default encoding",
                              "name": "encoding",
                              "type": "string",
                              "desc": "The new default encoding"
                            }
                          ]
                        }
                      ],
                      "desc": "<p>The <code>writable.setDefaultEncoding()</code> method sets the default <code>encoding</code> for a\n<a href=\"stream.html#stream_class_stream_writable\"><code>Writable</code></a> stream.</p>"
                    },
                    {
                      "textRaw": "`writable.uncork()`",
                      "type": "method",
                      "name": "uncork",
                      "meta": {
                        "added": [
                          "v0.11.2"
                        ],
                        "changes": []
                      },
                      "signatures": [
                        {
                          "params": []
                        }
                      ],
                      "desc": "<p>The <code>writable.uncork()</code> method flushes all data buffered since\n<a href=\"stream.html#stream_writable_cork\"><code>stream.cork()</code></a> was called.</p>\n<p>When using <a href=\"stream.html#stream_writable_cork\"><code>writable.cork()</code></a> and <code>writable.uncork()</code> to manage the buffering\nof writes to a stream, it is recommended that calls to <code>writable.uncork()</code> be\ndeferred using <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=\"stream.html#stream_writable_cork\"><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=\"stream.html#stream_writable_cork\"><code>writable.cork()</code></a>.</p>"
                    },
                    {
                      "textRaw": "`writable.write(chunk[, encoding][, callback])`",
                      "type": "method",
                      "name": "write",
                      "meta": {
                        "added": [
                          "v0.9.4"
                        ],
                        "changes": [
                          {
                            "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": [
                        {
                          "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`."
                          },
                          "params": [
                            {
                              "textRaw": "`chunk` {string|Buffer|Uint8Array|any} Optional data to write. For streams not operating in object mode, `chunk` must be a string, `Buffer` or `Uint8Array`. For object mode streams, `chunk` may be any JavaScript value other than `null`.",
                              "name": "chunk",
                              "type": "string|Buffer|Uint8Array|any",
                              "desc": "Optional data to write. For streams not operating in object mode, `chunk` must be a string, `Buffer` or `Uint8Array`. For object mode streams, `chunk` may be any JavaScript value other than `null`."
                            },
                            {
                              "textRaw": "`encoding` {string} The encoding, if `chunk` is a string. **Default:** `'utf8'`",
                              "name": "encoding",
                              "type": "string",
                              "default": "`'utf8'`",
                              "desc": "The encoding, if `chunk` is a string."
                            },
                            {
                              "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"
                            }
                          ]
                        }
                      ],
                      "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> <em>may or may not</em> be called with the error as its\nfirst argument. To reliably detect write errors, add a listener for the\n<code>'error'</code> event.</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=\"stream.html#stream_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.\nIt is recommended that once <code>write()</code> returns false, no more chunks be written\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=\"stream.html#stream_class_stream_transform\"><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=\"stream.html#stream_class_stream_readable\"><code>Readable</code></a> and use\n<a href=\"stream.html#stream_readable_pipe_destination_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=\"stream.html#stream_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": "`destroyed` {boolean}",
                      "type": "boolean",
                      "name": "destroyed",
                      "meta": {
                        "added": [
                          "v8.0.0"
                        ],
                        "changes": []
                      },
                      "desc": "<p>Is <code>true</code> after <a href=\"stream.html#stream_writable_destroy_error\"><code>writable.destroy()</code></a> has been called.</p>"
                    },
                    {
                      "textRaw": "`writable` {boolean}",
                      "type": "boolean",
                      "name": "writable",
                      "meta": {
                        "added": [
                          "v11.4.0"
                        ],
                        "changes": []
                      },
                      "desc": "<p>Is <code>true</code> if it is safe to call <a href=\"stream.html#stream_writable_write_chunk_encoding_callback\"><code>writable.write()</code></a>.</p>"
                    },
                    {
                      "textRaw": "`writableEnded` {boolean}",
                      "type": "boolean",
                      "name": "writableEnded",
                      "meta": {
                        "added": [
                          "v12.9.0"
                        ],
                        "changes": []
                      },
                      "desc": "<p>Is <code>true</code> after <a href=\"stream.html#stream_writable_end_chunk_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=\"stream.html#stream_writable_writablefinished\"><code>writable.writableFinished</code></a> instead.</p>"
                    },
                    {
                      "textRaw": "`writableCorked` {integer}",
                      "type": "integer",
                      "name": "writableCorked",
                      "meta": {
                        "added": [
                          "v12.16.0"
                        ],
                        "changes": []
                      },
                      "desc": "<p>Number of times <a href=\"stream.html#stream_writable_uncork\"><code>writable.uncork()</code></a> needs to be\ncalled in order to fully uncork the stream.</p>"
                    },
                    {
                      "textRaw": "`writableFinished` {boolean}",
                      "type": "boolean",
                      "name": "writableFinished",
                      "meta": {
                        "added": [
                          "v12.6.0"
                        ],
                        "changes": []
                      },
                      "desc": "<p>Is set to <code>true</code> immediately before the <a href=\"stream.html#stream_event_finish\"><code>'finish'</code></a> event is emitted.</p>"
                    },
                    {
                      "textRaw": "`writableHighWaterMark` {number}",
                      "type": "number",
                      "name": "writableHighWaterMark",
                      "meta": {
                        "added": [
                          "v9.3.0"
                        ],
                        "changes": []
                      },
                      "desc": "<p>Return the value of <code>highWaterMark</code> passed when constructing this\n<code>Writable</code>.</p>"
                    },
                    {
                      "textRaw": "`writableLength` {number}",
                      "type": "number",
                      "name": "writableLength",
                      "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": "`writableObjectMode` {boolean}",
                      "type": "boolean",
                      "name": "writableObjectMode",
                      "meta": {
                        "added": [
                          "v12.3.0"
                        ],
                        "changes": []
                      },
                      "desc": "<p>Getter for the property <code>objectMode</code> of a given <code>Writable</code> stream.</p>"
                    }
                  ]
                }
              ],
              "type": "misc",
              "displayName": "Writable streams"
            },
            {
              "textRaw": "Readable streams",
              "name": "readable_streams",
              "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#http_class_http_incomingmessage\">HTTP responses, on the client</a></li>\n<li><a href=\"http.html#http_class_http_incomingmessage\">HTTP requests, on the server</a></li>\n<li><a href=\"fs.html#fs_class_fs_readstream\">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#net_class_net_socket\">TCP sockets</a></li>\n<li><a href=\"child_process.html#child_process_subprocess_stdout\">child process stdout and stderr</a></li>\n<li><a href=\"process.html#process_process_stdin\"><code>process.stdin</code></a></li>\n</ul>\n<p>All <a href=\"stream.html#stream_class_stream_readable\"><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",
                  "desc": "<p><code>Readable</code> streams effectively operate in one of two modes: flowing and\npaused. These modes are separate from <a href=\"stream.html#stream_object_mode\">object mode</a>.\nA <a href=\"stream.html#stream_class_stream_readable\"><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#events_class_eventemitter\"><code>EventEmitter</code></a> interface.</p>\n</li>\n<li>\n<p>In paused mode, the <a href=\"stream.html#stream_readable_read_size\"><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=\"stream.html#stream_class_stream_readable\"><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=\"stream.html#stream_event_data\"><code>'data'</code></a> event handler.</li>\n<li>Calling the <a href=\"stream.html#stream_readable_resume\"><code>stream.resume()</code></a> method.</li>\n<li>Calling the <a href=\"stream.html#stream_readable_pipe_destination_options\"><code>stream.pipe()</code></a> method to send the data to a <a href=\"stream.html#stream_class_stream_writable\"><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=\"stream.html#stream_readable_pause\"><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=\"stream.html#stream_readable_unpipe_destination\"><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=\"stream.html#stream_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=\"stream.html#stream_readable_pause\"><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=\"stream.html#stream_class_stream_readable\"><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=\"stream.html#stream_event_readable\"><code>'readable'</code></a> event handler automatically make the stream to\nstop flowing, and the data to be consumed via\n<a href=\"stream.html#stream_readable_read_size\"><code>readable.read()</code></a>. If the <a href=\"stream.html#stream_event_readable\"><code>'readable'</code></a> event handler is\nremoved, then the stream will start flowing again if there is a\n<a href=\"stream.html#stream_event_data\"><code>'data'</code></a> event handler.</p>",
                  "type": "module",
                  "displayName": "Two reading modes"
                },
                {
                  "textRaw": "Three states",
                  "name": "three_states",
                  "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('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()); });\npass.write('ok');  // Will not emit 'data'.\npass.resume();     // Must be called to make stream emit 'data'.\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>",
                  "type": "module",
                  "displayName": "Three states"
                },
                {
                  "textRaw": "Choose one API style",
                  "name": "choose_one_api_style",
                  "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>\n<p>Use of the <code>readable.pipe()</code> method is recommended for most users as it has been\nimplemented to provide the easiest way of consuming stream data. Developers that\nrequire more fine-grained control over the transfer and generation of data can\nuse the <a href=\"events.html#events_class_eventemitter\"><code>EventEmitter</code></a> and <code>readable.on('readable')</code>/<code>readable.read()</code>\nor the <code>readable.pause()</code>/<code>readable.resume()</code> APIs.</p>",
                  "type": "module",
                  "displayName": "Choose one API style"
                }
              ],
              "classes": [
                {
                  "textRaw": "Class: `stream.Readable`",
                  "type": "class",
                  "name": "stream.Readable",
                  "meta": {
                    "added": [
                      "v0.9.4"
                    ],
                    "changes": []
                  },
                  "events": [
                    {
                      "textRaw": "Event: `'close'`",
                      "type": "event",
                      "name": "close",
                      "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=\"stream.html#stream_class_stream_readable\"><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'`",
                      "type": "event",
                      "name": "data",
                      "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'`",
                      "type": "event",
                      "name": "end",
                      "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=\"stream.html#stream_readable_read_size\"><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'`",
                      "type": "event",
                      "name": "error",
                      "meta": {
                        "added": [
                          "v0.9.4"
                        ],
                        "changes": []
                      },
                      "params": [
                        {
                          "textRaw": "{Error}",
                          "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'`",
                      "type": "event",
                      "name": "pause",
                      "meta": {
                        "added": [
                          "v0.9.4"
                        ],
                        "changes": []
                      },
                      "params": [],
                      "desc": "<p>The <code>'pause'</code> event is emitted when <a href=\"stream.html#stream_readable_pause\"><code>stream.pause()</code></a> is called\nand <code>readableFlowing</code> is not <code>false</code>.</p>"
                    },
                    {
                      "textRaw": "Event: `'readable'`",
                      "type": "event",
                      "name": "readable",
                      "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. In some cases, attaching a listener for the <code>'readable'</code> event will\ncause some amount of data to be read into an internal buffer.</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()) {\n    console.log(data);\n  }\n});\n</code></pre>\n<p>The <code>'readable'</code> event will also be emitted once the end of the stream data\nhas been reached but before the <code>'end'</code> event is emitted.</p>\n<p>Effectively, the <code>'readable'</code> event indicates that the stream has new\ninformation: either new data is available or the end of the stream has been\nreached. In the former case, <a href=\"stream.html#stream_readable_read_size\"><code>stream.read()</code></a> will return the\navailable data. In the latter case, <a href=\"stream.html#stream_readable_read_size\"><code>stream.read()</code></a> will return\n<code>null</code>. For instance, in the following example, <code>foo.txt</code> is an empty file:</p>\n<pre><code class=\"language-js\">const fs = require('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 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=\"stream.html#stream_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=\"stream.html#stream_readable_read_size\"><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'`",
                      "type": "event",
                      "name": "resume",
                      "meta": {
                        "added": [
                          "v0.9.4"
                        ],
                        "changes": []
                      },
                      "params": [],
                      "desc": "<p>The <code>'resume'</code> event is emitted when <a href=\"stream.html#stream_readable_resume\"><code>stream.resume()</code></a> is\ncalled and <code>readableFlowing</code> is not <code>true</code>.</p>"
                    }
                  ],
                  "methods": [
                    {
                      "textRaw": "`readable.destroy([error])`",
                      "type": "method",
                      "name": "destroy",
                      "meta": {
                        "added": [
                          "v8.0.0"
                        ],
                        "changes": []
                      },
                      "signatures": [
                        {
                          "return": {
                            "textRaw": "Returns: {this}",
                            "name": "return",
                            "type": "this"
                          },
                          "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"
                            }
                          ]
                        }
                      ],
                      "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.\nImplementors should not override this method, but instead implement\n<a href=\"stream.html#stream_readable_destroy_err_callback\"><code>readable._destroy()</code></a>.</p>"
                    },
                    {
                      "textRaw": "`readable.isPaused()`",
                      "type": "method",
                      "name": "isPaused",
                      "meta": {
                        "added": [
                          "v0.11.14"
                        ],
                        "changes": []
                      },
                      "signatures": [
                        {
                          "return": {
                            "textRaw": "Returns: {boolean}",
                            "name": "return",
                            "type": "boolean"
                          },
                          "params": []
                        }
                      ],
                      "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()`",
                      "type": "method",
                      "name": "pause",
                      "meta": {
                        "added": [
                          "v0.9.4"
                        ],
                        "changes": []
                      },
                      "signatures": [
                        {
                          "return": {
                            "textRaw": "Returns: {this}",
                            "name": "return",
                            "type": "this"
                          },
                          "params": []
                        }
                      ],
                      "desc": "<p>The <code>readable.pause()</code> method will cause a stream in flowing mode to stop\nemitting <a href=\"stream.html#stream_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])`",
                      "type": "method",
                      "name": "pipe",
                      "meta": {
                        "added": [
                          "v0.9.4"
                        ],
                        "changes": []
                      },
                      "signatures": [
                        {
                          "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"
                          },
                          "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."
                                }
                              ]
                            }
                          ]
                        }
                      ],
                      "desc": "<p>The <code>readable.pipe()</code> method attaches a <a href=\"stream.html#stream_class_stream_writable\"><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=\"stream.html#stream_class_stream_writable\"><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('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('fs');\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=\"stream.html#stream_writable_end_chunk_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=\"stream.html#stream_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#process_process_stderr\"><code>process.stderr</code></a> and <a href=\"process.html#process_process_stdout\"><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])`",
                      "type": "method",
                      "name": "read",
                      "meta": {
                        "added": [
                          "v0.9.4"
                        ],
                        "changes": []
                      },
                      "signatures": [
                        {
                          "return": {
                            "textRaw": "Returns: {string|Buffer|null|any}",
                            "name": "return",
                            "type": "string|Buffer|null|any"
                          },
                          "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."
                            }
                          ]
                        }
                      ],
                      "desc": "<p>The <code>readable.read()</code> method pulls some data out of the internal buffer and\nreturns it. If no data available to be read, <code>null</code> is returned. By default,\nthe data will be 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 GB.</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();\nreadable.on('readable', () => {\n  let chunk;\n  while (null !== (chunk = readable.read())) {\n    console.log(`Received ${chunk.length} bytes of data.`);\n  }\n});\n</code></pre>\n<p>The <code>while</code> loop is necessary when processing data with\n<code>readable.read()</code>. Only after <code>readable.read()</code> returns <code>null</code>,\n<a href=\"stream.html#stream_event_readable\"><code>'readable'</code></a> will be emitted.</p>\n<p>A <code>Readable</code> stream in object mode will always return a single item from\na call to <a href=\"stream.html#stream_readable_read_size\"><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=\"stream.html#stream_readable_read_size\"><code>stream.read([size])</code></a> after the <a href=\"stream.html#stream_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()`",
                      "type": "method",
                      "name": "resume",
                      "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": [
                        {
                          "return": {
                            "textRaw": "Returns: {this}",
                            "name": "return",
                            "type": "this"
                          },
                          "params": []
                        }
                      ],
                      "desc": "<p>The <code>readable.resume()</code> method causes an explicitly paused <code>Readable</code> stream to\nresume emitting <a href=\"stream.html#stream_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)`",
                      "type": "method",
                      "name": "setEncoding",
                      "meta": {
                        "added": [
                          "v0.9.4"
                        ],
                        "changes": []
                      },
                      "signatures": [
                        {
                          "return": {
                            "textRaw": "Returns: {this}",
                            "name": "return",
                            "type": "this"
                          },
                          "params": [
                            {
                              "textRaw": "`encoding` {string} The encoding to use.",
                              "name": "encoding",
                              "type": "string",
                              "desc": "The encoding to use."
                            }
                          ]
                        }
                      ],
                      "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])`",
                      "type": "method",
                      "name": "unpipe",
                      "meta": {
                        "added": [
                          "v0.9.4"
                        ],
                        "changes": []
                      },
                      "signatures": [
                        {
                          "return": {
                            "textRaw": "Returns: {this}",
                            "name": "return",
                            "type": "this"
                          },
                          "params": [
                            {
                              "textRaw": "`destination` {stream.Writable} Optional specific stream to unpipe",
                              "name": "destination",
                              "type": "stream.Writable",
                              "desc": "Optional specific stream to unpipe"
                            }
                          ]
                        }
                      ],
                      "desc": "<p>The <code>readable.unpipe()</code> method detaches a <code>Writable</code> stream previously attached\nusing the <a href=\"stream.html#stream_readable_pipe_destination_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('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])`",
                      "type": "method",
                      "name": "unshift",
                      "meta": {
                        "added": [
                          "v0.9.11"
                        ],
                        "changes": [
                          {
                            "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|Uint8Array|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`, `Uint8Array` or `null`. For object mode streams, `chunk` may be any JavaScript value.",
                              "name": "chunk",
                              "type": "Buffer|Uint8Array|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`, `Uint8Array` 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'`."
                            }
                          ]
                        }
                      ],
                      "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=\"stream.html#stream_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=\"stream.html#stream_class_stream_transform\"><code>Transform</code></a> stream instead. See the <a href=\"stream.html#stream_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('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.match(/\\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      } else {\n        // Still reading the header.\n        header += str;\n      }\n    }\n  }\n}\n</code></pre>\n<p>Unlike <a href=\"stream.html#stream_readable_push_chunk_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=\"stream.html#stream_readable_read_size_1\"><code>stream._read()</code></a> implementation on a\ncustom stream). Following the call to <code>readable.unshift()</code> with an immediate\n<a href=\"stream.html#stream_readable_push_chunk_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)`",
                      "type": "method",
                      "name": "wrap",
                      "meta": {
                        "added": [
                          "v0.9.4"
                        ],
                        "changes": []
                      },
                      "signatures": [
                        {
                          "return": {
                            "textRaw": "Returns: {this}",
                            "name": "return",
                            "type": "this"
                          },
                          "params": [
                            {
                              "textRaw": "`stream` {Stream} An \"old style\" readable stream",
                              "name": "stream",
                              "type": "Stream",
                              "desc": "An \"old style\" readable stream"
                            }
                          ]
                        }
                      ],
                      "desc": "<p>Prior to Node.js 0.10, streams did not implement the entire <code>stream</code> module API\nas it is currently defined. (See <a href=\"stream.html#stream_compatibility_with_older_node_js_versions\">Compatibility</a> for more information.)</p>\n<p>When using an older Node.js library that emits <a href=\"stream.html#stream_event_data\"><code>'data'</code></a> events and has a\n<a href=\"stream.html#stream_readable_pause\"><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=\"stream.html#stream_class_stream_readable\"><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('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]()`",
                      "type": "method",
                      "name": "[Symbol.asyncIterator]",
                      "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": [
                        {
                          "return": {
                            "textRaw": "Returns: {AsyncIterator} to fully consume the stream.",
                            "name": "return",
                            "type": "AsyncIterator",
                            "desc": "to fully consume the stream."
                          },
                          "params": []
                        }
                      ],
                      "desc": "<pre><code class=\"language-js\">const fs = require('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> or a <code>throw</code>, the stream will be\ndestroyed. 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 64KB of data because no <code>highWaterMark</code> option is provided to\n<a href=\"fs.html#fs_fs_createreadstream_path_options\"><code>fs.createReadStream()</code></a>.</p>"
                    }
                  ],
                  "properties": [
                    {
                      "textRaw": "`destroyed` {boolean}",
                      "type": "boolean",
                      "name": "destroyed",
                      "meta": {
                        "added": [
                          "v8.0.0"
                        ],
                        "changes": []
                      },
                      "desc": "<p>Is <code>true</code> after <a href=\"stream.html#stream_readable_destroy_error\"><code>readable.destroy()</code></a> has been called.</p>"
                    },
                    {
                      "textRaw": "`readable` {boolean}",
                      "type": "boolean",
                      "name": "readable",
                      "meta": {
                        "added": [
                          "v11.4.0"
                        ],
                        "changes": []
                      },
                      "desc": "<p>Is <code>true</code> if it is safe to call <a href=\"stream.html#stream_readable_read_size\"><code>readable.read()</code></a>.</p>"
                    },
                    {
                      "textRaw": "`readableEncoding` {null|string}",
                      "type": "null|string",
                      "name": "readableEncoding",
                      "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=\"stream.html#stream_readable_setencoding_encoding\"><code>readable.setEncoding()</code></a> method.</p>"
                    },
                    {
                      "textRaw": "`readableEnded` {boolean}",
                      "type": "boolean",
                      "name": "readableEnded",
                      "meta": {
                        "added": [
                          "v12.9.0"
                        ],
                        "changes": []
                      },
                      "desc": "<p>Becomes <code>true</code> when <a href=\"stream.html#stream_event_end\"><code>'end'</code></a> event is emitted.</p>"
                    },
                    {
                      "textRaw": "`readableFlowing` {boolean}",
                      "type": "boolean",
                      "name": "readableFlowing",
                      "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=\"stream.html#stream_three_states\">Three states</a> section.</p>"
                    },
                    {
                      "textRaw": "`readableHighWaterMark` {number}",
                      "type": "number",
                      "name": "readableHighWaterMark",
                      "meta": {
                        "added": [
                          "v9.3.0"
                        ],
                        "changes": []
                      },
                      "desc": "<p>Returns the value of <code>highWaterMark</code> passed when constructing this\n<code>Readable</code>.</p>"
                    },
                    {
                      "textRaw": "`readableLength` {number}",
                      "type": "number",
                      "name": "readableLength",
                      "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": "`readableObjectMode` {boolean}",
                      "type": "boolean",
                      "name": "readableObjectMode",
                      "meta": {
                        "added": [
                          "v12.3.0"
                        ],
                        "changes": []
                      },
                      "desc": "<p>Getter for the property <code>objectMode</code> of a given <code>Readable</code> stream.</p>"
                    }
                  ]
                }
              ],
              "type": "misc",
              "displayName": "Readable streams"
            },
            {
              "textRaw": "Duplex and transform streams",
              "name": "duplex_and_transform_streams",
              "classes": [
                {
                  "textRaw": "Class: `stream.Duplex`",
                  "type": "class",
                  "name": "stream.Duplex",
                  "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=\"stream.html#stream_class_stream_readable\"><code>Readable</code></a> and\n<a href=\"stream.html#stream_class_stream_writable\"><code>Writable</code></a> interfaces.</p>\n<p>Examples of <code>Duplex</code> streams include:</p>\n<ul>\n<li><a href=\"net.html#net_class_net_socket\">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>"
                },
                {
                  "textRaw": "Class: `stream.Transform`",
                  "type": "class",
                  "name": "stream.Transform",
                  "meta": {
                    "added": [
                      "v0.9.4"
                    ],
                    "changes": []
                  },
                  "desc": "<p>Transform streams are <a href=\"stream.html#stream_class_stream_duplex\"><code>Duplex</code></a> streams where the output is in some way\nrelated to the input. Like all <a href=\"stream.html#stream_class_stream_duplex\"><code>Duplex</code></a> streams, <code>Transform</code> streams\nimplement both the <a href=\"stream.html#stream_class_stream_readable\"><code>Readable</code></a> and <a href=\"stream.html#stream_class_stream_writable\"><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])`",
                      "type": "method",
                      "name": "destroy",
                      "meta": {
                        "added": [
                          "v8.0.0"
                        ],
                        "changes": []
                      },
                      "signatures": [
                        {
                          "return": {
                            "textRaw": "Returns: {this}",
                            "name": "return",
                            "type": "this"
                          },
                          "params": [
                            {
                              "textRaw": "`error` {Error}",
                              "name": "error",
                              "type": "Error"
                            }
                          ]
                        }
                      ],
                      "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=\"stream.html#stream_readable_destroy_err_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>"
                    }
                  ]
                }
              ],
              "type": "misc",
              "displayName": "Duplex and transform streams"
            }
          ],
          "methods": [
            {
              "textRaw": "`stream.finished(stream[, options], callback)`",
              "type": "method",
              "name": "finished",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "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."
                  },
                  "params": [
                    {
                      "textRaw": "`stream` {Stream} A readable and/or writable stream.",
                      "name": "stream",
                      "type": "Stream",
                      "desc": "A readable and/or writable stream."
                    },
                    {
                      "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",
                          "desc": "If set to `false`, then a call to `emit('error', err)` is not treated as finished. **Default**: `true`."
                        },
                        {
                          "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",
                          "desc": "When set to `false`, the callback will be called when the stream ends even though the stream might still be readable. **Default**: `true`."
                        },
                        {
                          "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",
                          "desc": "When set to `false`, the callback will be called when the stream ends even though the stream might still be writable. **Default**: `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."
                    }
                  ]
                }
              ],
              "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('stream');\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 is promisify-able as well;</p>\n<pre><code class=\"language-js\">const finished = util.promisify(stream.finished);\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<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(...streams, callback)`",
              "type": "method",
              "name": "pipeline",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`...streams` {Stream} Two or more streams to pipe between.",
                      "name": "...streams",
                      "type": "Stream",
                      "desc": "Two or more streams to pipe between."
                    },
                    {
                      "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"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>A module method to pipe between streams forwarding errors and properly cleaning\nup and provide a callback when the pipeline is complete.</p>\n<pre><code class=\"language-js\">const { pipeline } = require('stream');\nconst fs = require('fs');\nconst zlib = require('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 is promisify-able as well:</p>\n<pre><code class=\"language-js\">const pipeline = util.promisify(stream.pipeline);\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<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.</p>"
            },
            {
              "textRaw": "`stream.Readable.from(iterable, [options])`",
              "type": "method",
              "name": "from",
              "meta": {
                "added": [
                  "v12.3.0",
                  "v10.17.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {stream.Readable}",
                    "name": "return",
                    "type": "stream.Readable"
                  },
                  "params": [
                    {
                      "textRaw": "`iterable` {Iterable} Object implementing the `Symbol.asyncIterator` or `Symbol.iterator` iterable protocol. Emits an 'error' event if a null value is passed.",
                      "name": "iterable",
                      "type": "Iterable",
                      "desc": "Object implementing the `Symbol.asyncIterator` or `Symbol.iterator` iterable protocol. Emits an 'error' event if a null value is passed."
                    },
                    {
                      "textRaw": "`options` {Object} Options provided to `new stream.Readable([options])`. By default, `Readable.from()` will set `options.objectMode` to `true`, unless this is explicitly opted out by setting `options.objectMode` to `false`.",
                      "name": "options",
                      "type": "Object",
                      "desc": "Options provided to `new stream.Readable([options])`. By default, `Readable.from()` will set `options.objectMode` to `true`, unless this is explicitly opted out by setting `options.objectMode` to `false`."
                    }
                  ]
                }
              ],
              "desc": "<p>A utility method for creating readable streams out of iterators.</p>\n<pre><code class=\"language-js\">const { Readable } = require('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>"
            }
          ]
        },
        {
          "textRaw": "API for stream implementers",
          "name": "API for stream implementers",
          "type": "misc",
          "desc": "<p>The <code>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<!-- eslint-disable no-useless-constructor -->\n<pre><code class=\"language-js\">const { Writable } = require('stream');\n\nclass MyWritable extends Writable {\n  constructor({ highWaterMark, ...options }) {\n    super({\n      highWaterMark,\n      autoDestroy: true,\n      emitClose: true\n    });\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=\"stream.html#stream_class_stream_readable\"><code>Readable</code></a></td>\n<td><a href=\"stream.html#stream_readable_read_size_1\"><code>_read()</code></a></td>\n</tr>\n<tr>\n<td>Writing only</td>\n<td><a href=\"stream.html#stream_class_stream_writable\"><code>Writable</code></a></td>\n<td><a href=\"stream.html#stream_writable_write_chunk_encoding_callback_1\"><code>_write()</code></a>, <a href=\"stream.html#stream_writable_writev_chunks_callback\"><code>_writev()</code></a>, <a href=\"stream.html#stream_writable_final_callback\"><code>_final()</code></a></td>\n</tr>\n<tr>\n<td>Reading and writing</td>\n<td><a href=\"stream.html#stream_class_stream_duplex\"><code>Duplex</code></a></td>\n<td><a href=\"stream.html#stream_readable_read_size_1\"><code>_read()</code></a>, <a href=\"stream.html#stream_writable_write_chunk_encoding_callback_1\"><code>_write()</code></a>, <a href=\"stream.html#stream_writable_writev_chunks_callback\"><code>_writev()</code></a>, <a href=\"stream.html#stream_writable_final_callback\"><code>_final()</code></a></td>\n</tr>\n<tr>\n<td>Operate on written data, then read the result</td>\n<td><a href=\"stream.html#stream_class_stream_transform\"><code>Transform</code></a></td>\n<td><a href=\"stream.html#stream_transform_transform_chunk_encoding_callback\"><code>_transform()</code></a>, <a href=\"stream.html#stream_transform_flush_callback\"><code>_flush()</code></a>, <a href=\"stream.html#stream_writable_final_callback\"><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=\"stream.html#stream_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",
              "meta": {
                "added": [
                  "v1.2.0"
                ],
                "changes": []
              },
              "desc": "<p>For many simple cases, it is possible to construct 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('stream');\n\nconst myWritable = new Writable({\n  write(chunk, encoding, callback) {\n    // ...\n  }\n});\n</code></pre>",
              "type": "misc",
              "displayName": "Simplified construction"
            },
            {
              "textRaw": "Implementing a writable stream",
              "name": "implementing_a_writable_stream",
              "desc": "<p>The <code>stream.Writable</code> class is extended to implement a <a href=\"stream.html#stream_class_stream_writable\"><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>",
              "ctors": [
                {
                  "textRaw": "Constructor: `new stream.Writable([options])`",
                  "type": "ctor",
                  "name": "stream.Writable",
                  "meta": {
                    "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."
                      },
                      {
                        "version": "v11.2.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."
                      }
                    ]
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`options` {Object}",
                          "name": "options",
                          "type": "Object",
                          "options": [
                            {
                              "textRaw": "`highWaterMark` {number} Buffer level when [`stream.write()`][stream-write] starts returning `false`. **Default:** `16384` (16KB), or `16` for `objectMode` streams.",
                              "name": "highWaterMark",
                              "type": "number",
                              "default": "`16384` (16KB), or `16` for `objectMode` streams",
                              "desc": "Buffer level when [`stream.write()`][stream-write] starts returning `false`."
                            },
                            {
                              "textRaw": "`decodeStrings` {boolean} Whether to encode `string`s passed to [`stream.write()`][stream-write] to `Buffer`s (with the encoding specified in the [`stream.write()`][stream-write] call) before passing them to [`stream._write()`][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()`][stream-write] to `Buffer`s (with the encoding specified in the [`stream.write()`][stream-write] call) before passing them to [`stream._write()`][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()`][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()`][stream-write]."
                            },
                            {
                              "textRaw": "`objectMode` {boolean} Whether or not the [`stream.write(anyObj)`][stream-write] is a valid operation. When set, it becomes possible to write JavaScript values other than string, `Buffer` or `Uint8Array` if supported by the stream implementation. **Default:** `false`.",
                              "name": "objectMode",
                              "type": "boolean",
                              "default": "`false`",
                              "desc": "Whether or not the [`stream.write(anyObj)`][stream-write] is a valid operation. When set, it becomes possible to write JavaScript values other than string, `Buffer` or `Uint8Array` 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()`][stream-_write] method.",
                              "name": "write",
                              "type": "Function",
                              "desc": "Implementation for the [`stream._write()`][stream-_write] method."
                            },
                            {
                              "textRaw": "`writev` {Function} Implementation for the [`stream._writev()`][stream-_writev] method.",
                              "name": "writev",
                              "type": "Function",
                              "desc": "Implementation for the [`stream._writev()`][stream-_writev] method."
                            },
                            {
                              "textRaw": "`destroy` {Function} Implementation for the [`stream._destroy()`][writable-_destroy] method.",
                              "name": "destroy",
                              "type": "Function",
                              "desc": "Implementation for the [`stream._destroy()`][writable-_destroy] method."
                            },
                            {
                              "textRaw": "`final` {Function} Implementation for the [`stream._final()`][stream-_final] method.",
                              "name": "final",
                              "type": "Function",
                              "desc": "Implementation for the [`stream._final()`][stream-_final] method."
                            },
                            {
                              "textRaw": "`autoDestroy` {boolean} Whether this stream should automatically call `.destroy()` on itself after ending. **Default:** `false`.",
                              "name": "autoDestroy",
                              "type": "boolean",
                              "default": "`false`",
                              "desc": "Whether this stream should automatically call `.destroy()` on itself after ending."
                            }
                          ]
                        }
                      ]
                    }
                  ],
                  "desc": "<!-- eslint-disable no-useless-constructor -->\n<pre><code class=\"language-js\">const { Writable } = require('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('stream');\nconst util = require('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('stream');\n\nconst myWritable = new Writable({\n  write(chunk, encoding, callback) {\n    // ...\n  },\n  writev(chunks, callback) {\n    // ...\n  }\n});\n</code></pre>"
                }
              ],
              "methods": [
                {
                  "textRaw": "`writable._write(chunk, encoding, callback)`",
                  "type": "method",
                  "name": "_write",
                  "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()`][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()`][stream-write].",
                          "name": "chunk",
                          "type": "Buffer|string|any",
                          "desc": "The `Buffer` to be written, converted from the `string` passed to [`stream.write()`][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()`][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=\"stream.html#stream_writable_write_chunk_encoding_callback_1\"><code>writable._write()</code></a> and/or\n<a href=\"stream.html#stream_writable_writev_chunks_callback\"><code>writable._writev()</code></a> method to send data to the underlying\nresource.</p>\n<p><a href=\"stream.html#stream_class_stream_transform\"><code>Transform</code></a> streams provide their own implementation of the\n<a href=\"stream.html#stream_writable_write_chunk_encoding_callback_1\"><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> method must be called to signal either that the write completed\nsuccessfully or failed with an error. The first argument passed to the\n<code>callback</code> must be the <code>Error</code> object if the call failed or <code>null</code> if the\nwrite 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=\"stream.html#stream_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)`",
                  "type": "method",
                  "name": "_writev",
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`chunks` {Object[]} The chunks to be written. Each chunk has following format: `{ chunk: ..., encoding: ... }`.",
                          "name": "chunks",
                          "type": "Object[]",
                          "desc": "The chunks to be written. Each chunk has following format: `{ chunk: ..., encoding: ... }`."
                        },
                        {
                          "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)`",
                  "type": "method",
                  "name": "_destroy",
                  "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=\"stream.html#stream_writable_destroy_error\"><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)`",
                  "type": "method",
                  "name": "_final",
                  "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",
                  "desc": "<p>Errors occurring during the processing of the <a href=\"stream.html#stream_writable_write_chunk_encoding_callback_1\"><code>writable._write()</code></a>,\n<a href=\"stream.html#stream_writable_writev_chunks_callback\"><code>writable._writev()</code></a> and <a href=\"stream.html#stream_writable_final_callback\"><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('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>",
                  "type": "module",
                  "displayName": "Errors while writing"
                },
                {
                  "textRaw": "An example writable stream",
                  "name": "an_example_writable_stream",
                  "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=\"stream.html#stream_class_stream_writable\"><code>Writable</code></a> stream instance:</p>\n<pre><code class=\"language-js\">const { Writable } = require('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>",
                  "type": "module",
                  "displayName": "An example writable stream"
                },
                {
                  "textRaw": "Decoding buffers in a writable stream",
                  "name": "decoding_buffers_in_a_writable_stream",
                  "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=\"stream.html#stream_class_stream_writable\"><code>Writable</code></a>.</p>\n<pre><code class=\"language-js\">const { Writable } = require('stream');\nconst { StringDecoder } = require('string_decoder');\n\nclass StringWritable extends Writable {\n  constructor(options) {\n    super(options);\n    this._decoder = new StringDecoder(options &#x26;&#x26; 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>",
                  "type": "module",
                  "displayName": "Decoding buffers in a writable stream"
                }
              ],
              "type": "misc",
              "displayName": "Implementing a writable stream"
            },
            {
              "textRaw": "Implementing a readable stream",
              "name": "implementing_a_readable_stream",
              "desc": "<p>The <code>stream.Readable</code> class is extended to implement a <a href=\"stream.html#stream_class_stream_readable\"><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=\"stream.html#stream_readable_read_size_1\"><code>readable._read()</code></a> method.</p>",
              "ctors": [
                {
                  "textRaw": "`new stream.Readable([options])`",
                  "type": "ctor",
                  "name": "stream.Readable",
                  "meta": {
                    "changes": [
                      {
                        "version": "v11.2.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."
                      }
                    ]
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`options` {Object}",
                          "name": "options",
                          "type": "Object",
                          "options": [
                            {
                              "textRaw": "`highWaterMark` {number} The maximum [number of bytes][hwm-gotcha] to store in the internal buffer before ceasing to read from the underlying resource. **Default:** `16384` (16KB), or `16` for `objectMode` streams.",
                              "name": "highWaterMark",
                              "type": "number",
                              "default": "`16384` (16KB), or `16` for `objectMode` streams",
                              "desc": "The maximum [number of bytes][hwm-gotcha] 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)`][stream-read] 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)`][stream-read] 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()`][stream-_read] method.",
                              "name": "read",
                              "type": "Function",
                              "desc": "Implementation for the [`stream._read()`][stream-_read] method."
                            },
                            {
                              "textRaw": "`destroy` {Function} Implementation for the [`stream._destroy()`][readable-_destroy] method.",
                              "name": "destroy",
                              "type": "Function",
                              "desc": "Implementation for the [`stream._destroy()`][readable-_destroy] method."
                            },
                            {
                              "textRaw": "`autoDestroy` {boolean} Whether this stream should automatically call `.destroy()` on itself after ending. **Default:** `false`.",
                              "name": "autoDestroy",
                              "type": "boolean",
                              "default": "`false`",
                              "desc": "Whether this stream should automatically call `.destroy()` on itself after ending."
                            }
                          ]
                        }
                      ]
                    }
                  ],
                  "desc": "<!-- eslint-disable no-useless-constructor -->\n<pre><code class=\"language-js\">const { Readable } = require('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('stream');\nconst util = require('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('stream');\n\nconst myReadable = new Readable({\n  read(size) {\n    // ...\n  }\n});\n</code></pre>"
                }
              ],
              "methods": [
                {
                  "textRaw": "`readable._read(size)`",
                  "type": "method",
                  "name": "_read",
                  "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=\"stream.html#stream_readable_read_size_1\"><code>readable._read()</code></a> method to fetch data from the underlying resource.</p>\n<p>When <a href=\"stream.html#stream_readable_read_size_1\"><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=\"stream.html#stream_readable_push_chunk_encoding\"><code>this.push(dataChunk)</code></a> method. <code>_read()</code> should continue reading\nfrom the resource and pushing data until <code>readable.push()</code> returns <code>false</code>. Only\nwhen <code>_read()</code> is called again after it has stopped should it resume pushing\nadditional data onto the queue.</p>\n<p>Once the <a href=\"stream.html#stream_readable_read_size_1\"><code>readable._read()</code></a> method has been called, it will not be called\nagain until more data is pushed through the <a href=\"stream.html#stream_readable_push_chunk_encoding\"><code>readable.push()</code></a>\nmethod. Empty data such as empty buffers and strings will not cause\n<a href=\"stream.html#stream_readable_read_size_1\"><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=\"stream.html#stream_readable_push_chunk_encoding\"><code>stream.push(chunk)</code></a>.</p>\n<p>The <a href=\"stream.html#stream_readable_read_size_1\"><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)`",
                  "type": "method",
                  "name": "_destroy",
                  "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=\"stream.html#stream_readable_destroy_error\"><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])`",
                  "type": "method",
                  "name": "push",
                  "meta": {
                    "changes": [
                      {
                        "version": "v8.0.0",
                        "pr-url": "https://github.com/nodejs/node/pull/11608",
                        "description": "The `chunk` argument can now be a `Uint8Array` instance."
                      }
                    ]
                  },
                  "signatures": [
                    {
                      "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."
                      },
                      "params": [
                        {
                          "textRaw": "`chunk` {Buffer|Uint8Array|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` or `Uint8Array`. For object mode streams, `chunk` may be any JavaScript value.",
                          "name": "chunk",
                          "type": "Buffer|Uint8Array|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` or `Uint8Array`. 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'`."
                        }
                      ]
                    }
                  ],
                  "desc": "<p>When <code>chunk</code> is a <code>Buffer</code>, <code>Uint8Array</code> or <code>string</code>, the <code>chunk</code> of data will\nbe 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=\"stream.html#stream_readable_read_size\"><code>readable.read()</code></a> method when the <a href=\"stream.html#stream_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=\"stream.html#stream_readable_read_size_1\"><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=\"stream.html#stream_readable_push\"><code>readable.push('')</code></a> for more information.</p>"
                }
              ],
              "modules": [
                {
                  "textRaw": "Errors while reading",
                  "name": "errors_while_reading",
                  "desc": "<p>Errors occurring during processing of the <a href=\"stream.html#stream_readable_read_size_1\"><code>readable._read()</code></a> must be\npropagated through the <a href=\"stream.html#stream_readable_destroy_err_callback\"><code>readable.destroy(err)</code></a> method.\nThrowing an <code>Error</code> from within <a href=\"stream.html#stream_readable_read_size_1\"><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('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>",
                  "type": "module",
                  "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('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>"
                }
              ],
              "type": "misc",
              "displayName": "Implementing a readable stream"
            },
            {
              "textRaw": "Implementing a duplex stream",
              "name": "implementing_a_duplex_stream",
              "desc": "<p>A <a href=\"stream.html#stream_class_stream_duplex\"><code>Duplex</code></a> stream is one that implements both <a href=\"stream.html#stream_class_stream_readable\"><code>Readable</code></a> and\n<a href=\"stream.html#stream_class_stream_writable\"><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=\"stream.html#stream_class_stream_duplex\"><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=\"stream.html#stream_readable_read_size_1\"><code>readable._read()</code></a> and\n<code>writable._write()</code> methods.</p>",
              "ctors": [
                {
                  "textRaw": "`new stream.Duplex(options)`",
                  "type": "ctor",
                  "name": "stream.Duplex",
                  "meta": {
                    "changes": [
                      {
                        "version": "v8.4.0",
                        "pr-url": "https://github.com/nodejs/node/pull/14636",
                        "description": "The `readableHighWaterMark` and `writableHighWaterMark` options are supported now."
                      }
                    ]
                  },
                  "signatures": [
                    {
                      "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": "`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": "<!-- eslint-disable no-useless-constructor -->\n<pre><code class=\"language-js\">const { Duplex } = require('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('stream');\nconst util = require('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('stream');\n\nconst myDuplex = new Duplex({\n  read(size) {\n    // ...\n  },\n  write(chunk, encoding, callback) {\n    // ...\n  }\n});\n</code></pre>"
                }
              ],
              "modules": [
                {
                  "textRaw": "An example duplex stream",
                  "name": "an_example_duplex_stream",
                  "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=\"stream.html#stream_class_stream_writable\"><code>Writable</code></a> interface that is read back out\nvia the <a href=\"stream.html#stream_class_stream_readable\"><code>Readable</code></a> interface.</p>\n<pre><code class=\"language-js\">const { Duplex } = require('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>",
                  "type": "module",
                  "displayName": "An example duplex stream"
                },
                {
                  "textRaw": "Object mode duplex streams",
                  "name": "object_mode_duplex_streams",
                  "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=\"stream.html#stream_class_stream_duplex\"><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('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>",
                  "type": "module",
                  "displayName": "Object mode duplex streams"
                }
              ],
              "type": "misc",
              "displayName": "Implementing a duplex stream"
            },
            {
              "textRaw": "Implementing a transform stream",
              "name": "implementing_a_transform_stream",
              "desc": "<p>A <a href=\"stream.html#stream_class_stream_transform\"><code>Transform</code></a> stream is a <a href=\"stream.html#stream_class_stream_duplex\"><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=\"stream.html#stream_class_stream_transform\"><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=\"stream.html#stream_readable_read_size_1\"><code>readable._read()</code></a> methods. Custom <code>Transform</code> implementations <em>must</em>\nimplement the <a href=\"stream.html#stream_transform_transform_chunk_encoding_callback\"><code>transform._transform()</code></a> method and <em>may</em>\nalso implement the <a href=\"stream.html#stream_transform_flush_callback\"><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>",
              "ctors": [
                {
                  "textRaw": "`new stream.Transform([options])`",
                  "type": "ctor",
                  "name": "stream.Transform",
                  "signatures": [
                    {
                      "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()`][stream-_transform] method.",
                              "name": "transform",
                              "type": "Function",
                              "desc": "Implementation for the [`stream._transform()`][stream-_transform] method."
                            },
                            {
                              "textRaw": "`flush` {Function} Implementation for the [`stream._flush()`][stream-_flush] method.",
                              "name": "flush",
                              "type": "Function",
                              "desc": "Implementation for the [`stream._flush()`][stream-_flush] method."
                            }
                          ]
                        }
                      ]
                    }
                  ],
                  "desc": "<!-- eslint-disable no-useless-constructor -->\n<pre><code class=\"language-js\">const { Transform } = require('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('stream');\nconst util = require('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('stream');\n\nconst myTransform = new Transform({\n  transform(chunk, encoding, callback) {\n    // ...\n  }\n});\n</code></pre>"
                }
              ],
              "modules": [
                {
                  "textRaw": "Events: `'finish'` and `'end'`",
                  "name": "events:_`'finish'`_and_`'end'`",
                  "desc": "<p>The <a href=\"stream.html#stream_event_finish\"><code>'finish'</code></a> and <a href=\"stream.html#stream_event_end\"><code>'end'</code></a> events are from the <code>stream.Writable</code>\nand <code>stream.Readable</code> classes, respectively. The <code>'finish'</code> event is emitted\nafter <a href=\"stream.html#stream_writable_end_chunk_encoding_callback\"><code>stream.end()</code></a> is called and all chunks have been processed\nby <a href=\"stream.html#stream_transform_transform_chunk_encoding_callback\"><code>stream._transform()</code></a>. The <code>'end'</code> event is emitted\nafter all data has been output, which occurs after the callback in\n<a href=\"stream.html#stream_transform_flush_callback\"><code>transform._flush()</code></a> has been called.</p>",
                  "type": "module",
                  "displayName": "Events: `'finish'` and `'end'`"
                }
              ],
              "methods": [
                {
                  "textRaw": "`transform._flush(callback)`",
                  "type": "method",
                  "name": "_flush",
                  "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=\"stream.html#stream_class_stream_transform\"><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=\"stream.html#stream_event_end\"><code>'end'</code></a> event is emitted signaling the end of the\n<a href=\"stream.html#stream_class_stream_readable\"><code>Readable</code></a> stream.</p>\n<p>Within the <code>transform._flush()</code> implementation, the <code>readable.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)`",
                  "type": "method",
                  "name": "_transform",
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`chunk` {Buffer|string|any} The `Buffer` to be transformed, converted from the `string` passed to [`stream.write()`][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()`][stream-write].",
                          "name": "chunk",
                          "type": "Buffer|string|any",
                          "desc": "The `Buffer` to be transformed, converted from the `string` passed to [`stream.write()`][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()`][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>readable.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>readable.push()</code> method. In other words, 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`",
                  "type": "class",
                  "name": "stream.PassThrough",
                  "desc": "<p>The <code>stream.PassThrough</code> class is a trivial implementation of a <a href=\"stream.html#stream_class_stream_transform\"><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>"
                }
              ],
              "type": "misc",
              "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",
              "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",
                  "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>",
                  "type": "module",
                  "displayName": "Consuming readable streams with async iterators"
                },
                {
                  "textRaw": "Creating readable streams with async generators",
                  "name": "creating_readable_streams_with_async_generators",
                  "desc": "<p>We can construct a Node.js readable stream from an asynchronous generator\nusing the <code>Readable.from()</code> utility method:</p>\n<pre><code class=\"language-js\">const { Readable } = require('stream');\n\nasync function * generate() {\n  yield 'a';\n  yield 'b';\n  yield 'c';\n}\n\nconst readable = Readable.from(generate());\n\nreadable.on('data', (chunk) => {\n  console.log(chunk);\n});\n</code></pre>",
                  "type": "module",
                  "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>In the scenario of writing to a writable stream from an async iterator, ensure\nthe correct handling of backpressure and errors.</p>\n<pre><code class=\"language-js\">const { once } = require('events');\nconst finished = util.promisify(stream.finished);\n\nconst writable = fs.createWriteStream('./file');\n\nfunction drain(writable) {\n  if (writable.destroyed) {\n    return Promise.reject(new Error('premature close'));\n  }\n  return Promise.race([\n    once(writable, 'drain'),\n    once(writable, 'close')\n      .then(() => Promise.reject(new Error('premature close')))\n  ]);\n}\n\nasync function pump(iterable, writable) {\n  for await (const chunk of iterable) {\n    // Handle backpressure on write().\n    if (!writable.write(chunk)) {\n      await drain(writable);\n    }\n  }\n  writable.end();\n}\n\n(async function() {\n  // Ensure completion without errors.\n  await Promise.all([\n    pump(iterable, writable),\n    finished(writable)\n  ]);\n})();\n</code></pre>\n<p>In the above, errors on <code>write()</code> would be caught and thrown by the\n<code>once()</code> listener for the <code>'drain'</code> event, since <code>once()</code> will also handle the\n<code>'error'</code> event. To ensure completion of the write stream without errors,\nit is safer to use the <code>finished()</code> method as above, instead of using the\n<code>once()</code> listener for the <code>'finish'</code> event. Under certain cases, an <code>'error'</code>\nevent could be emitted by the writable stream after <code>'finish'</code> and as <code>once()</code>\nwill release the <code>'error'</code> handler on handling the <code>'finish'</code> event, it could\nresult in an unhandled error.</p>\n<p>Alternatively, the readable stream could be wrapped with <code>Readable.from()</code> and\nthen piped via <code>.pipe()</code>:</p>\n<pre><code class=\"language-js\">const finished = util.promisify(stream.finished);\n\nconst writable = fs.createWriteStream('./file');\n\n(async function() {\n  const readable = Readable.from(iterable);\n  readable.pipe(writable);\n  // Ensure completion without errors.\n  await finished(writable);\n})();\n</code></pre>\n<p>Or, using <code>stream.pipeline()</code> to pipe streams:</p>\n<pre><code class=\"language-js\">const pipeline = util.promisify(stream.pipeline);\n\nconst writable = fs.createWriteStream('./file');\n\n(async function() {\n  const readable = Readable.from(iterable);\n  await pipeline(readable, writable);\n})();\n</code></pre>"
                }
              ],
              "type": "misc",
              "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=\"stream.html#stream_readable_read_size\"><code>stream.read()</code></a> method,\n<a href=\"stream.html#stream_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=\"stream.html#stream_readable_pause\"><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=\"stream.html#stream_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=\"stream.html#stream_class_stream_readable\"><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=\"stream.html#stream_event_data\"><code>'data'</code></a> event handler is added, or when the\n<a href=\"stream.html#stream_readable_resume\"><code>stream.resume()</code></a> method is called. The effect is that, even\nwhen not using the new <a href=\"stream.html#stream_readable_read_size\"><code>stream.read()</code></a> method and\n<a href=\"stream.html#stream_event_readable\"><code>'readable'</code></a> event, it is no longer necessary to worry about losing\n<a href=\"stream.html#stream_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=\"stream.html#stream_event_data\"><code>'data'</code></a> event listener is added.</li>\n<li>The <a href=\"stream.html#stream_readable_resume\"><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=\"stream.html#stream_readable_resume\"><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=\"stream.html#stream_readable_wrap_stream\"><code>readable.wrap()</code></a> method.</p>"
            },
            {
              "textRaw": "`highWaterMark` discrepancy after calling `readable.setEncoding()`",
              "name": "`highwatermark`_discrepancy_after_calling_`readable.setencoding()`",
              "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>",
              "type": "misc",
              "displayName": "`highWaterMark` discrepancy after calling `readable.setEncoding()`"
            }
          ],
          "methods": [
            {
              "textRaw": "`readable.read(0)`",
              "type": "method",
              "name": "read",
              "signatures": [
                {
                  "params": []
                }
              ],
              "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=\"stream.html#stream_readable_read_size_1\"><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('')`",
              "type": "method",
              "name": "push",
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Use of <code>readable.push('')</code> is not recommended.</p>\n<p>Pushing a zero-byte string, <code>Buffer</code> or <code>Uint8Array</code> to a stream that is not in\nobject mode has an interesting side effect. Because it <em>is</em> a call to\n<a href=\"stream.html#stream_readable_push_chunk_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>"
            }
          ]
        }
      ],
      "type": "module",
      "displayName": "Stream"
    },
    {
      "textRaw": "String decoder",
      "name": "string_decoder",
      "introduced_in": "v0.10.0",
      "stability": 2,
      "stabilityText": "Stable",
      "desc": "<p>The <code>string_decoder</code> module provides an API for decoding <code>Buffer</code> objects into\nstrings 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-js\">const { StringDecoder } = require('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-js\">const { StringDecoder } = require('string_decoder');\nconst decoder = new StringDecoder('utf8');\n\nconst cent = Buffer.from([0xC2, 0xA2]);\nconsole.log(decoder.write(cent));\n\nconst euro = Buffer.from([0xE2, 0x82, 0xAC]);\nconsole.log(decoder.write(euro));\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-js\">const { StringDecoder } = require('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])));\n</code></pre>",
      "classes": [
        {
          "textRaw": "Class: `StringDecoder`",
          "type": "class",
          "name": "StringDecoder",
          "methods": [
            {
              "textRaw": "`stringDecoder.end([buffer])`",
              "type": "method",
              "name": "end",
              "meta": {
                "added": [
                  "v0.9.3"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {string}",
                    "name": "return",
                    "type": "string"
                  },
                  "params": [
                    {
                      "textRaw": "`buffer` {Buffer|TypedArray|DataView} A `Buffer`, or `TypedArray`, or `DataView` containing the bytes to decode.",
                      "name": "buffer",
                      "type": "Buffer|TypedArray|DataView",
                      "desc": "A `Buffer`, or `TypedArray`, or `DataView` containing the bytes to decode."
                    }
                  ]
                }
              ],
              "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.</p>"
            },
            {
              "textRaw": "`stringDecoder.write(buffer)`",
              "type": "method",
              "name": "write",
              "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": [
                {
                  "return": {
                    "textRaw": "Returns: {string}",
                    "name": "return",
                    "type": "string"
                  },
                  "params": [
                    {
                      "textRaw": "`buffer` {Buffer|TypedArray|DataView} A `Buffer`, or `TypedArray`, or `DataView` containing the bytes to decode.",
                      "name": "buffer",
                      "type": "Buffer|TypedArray|DataView",
                      "desc": "A `Buffer`, or `TypedArray`, or `DataView` containing the bytes to decode."
                    }
                  ]
                }
              ],
              "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>"
            }
          ],
          "signatures": [
            {
              "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."
                }
              ],
              "desc": "<p>Creates a new <code>StringDecoder</code> instance.</p>"
            }
          ]
        }
      ],
      "type": "module",
      "displayName": "String decoder"
    },
    {
      "textRaw": "Timers",
      "name": "timers",
      "introduced_in": "v0.10.0",
      "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('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`",
          "type": "class",
          "name": "Immediate",
          "desc": "<p>This object is created internally and is returned from <a href=\"timers.html#timers_setimmediate_callback_args\"><code>setImmediate()</code></a>. It\ncan be passed to <a href=\"timers.html#timers_clearimmediate_immediate\"><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=\"timers.html#timers_setimmediate_callback_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()`",
              "type": "method",
              "name": "hasRef",
              "meta": {
                "added": [
                  "v11.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  },
                  "params": []
                }
              ],
              "desc": "<p>If true, the <code>Immediate</code> object will keep the Node.js event loop active.</p>"
            },
            {
              "textRaw": "`immediate.ref()`",
              "type": "method",
              "name": "ref",
              "meta": {
                "added": [
                  "v9.7.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Immediate} a reference to `immediate`",
                    "name": "return",
                    "type": "Immediate",
                    "desc": "a reference to `immediate`"
                  },
                  "params": []
                }
              ],
              "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()`",
              "type": "method",
              "name": "unref",
              "meta": {
                "added": [
                  "v9.7.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Immediate} a reference to `immediate`",
                    "name": "return",
                    "type": "Immediate",
                    "desc": "a reference to `immediate`"
                  },
                  "params": []
                }
              ],
              "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": "Class: `Timeout`",
          "type": "class",
          "name": "Timeout",
          "desc": "<p>This object is created internally and is returned from <a href=\"timers.html#timers_settimeout_callback_delay_args\"><code>setTimeout()</code></a> and\n<a href=\"timers.html#timers_setinterval_callback_delay_args\"><code>setInterval()</code></a>. It can be passed to either <a href=\"timers.html#timers_cleartimeout_timeout\"><code>clearTimeout()</code></a> or\n<a href=\"timers.html#timers_clearinterval_timeout\"><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=\"timers.html#timers_settimeout_callback_delay_args\"><code>setTimeout()</code></a> or\n<a href=\"timers.html#timers_setinterval_callback_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.hasRef()`",
              "type": "method",
              "name": "hasRef",
              "meta": {
                "added": [
                  "v11.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  },
                  "params": []
                }
              ],
              "desc": "<p>If true, the <code>Timeout</code> object will keep the Node.js event loop active.</p>"
            },
            {
              "textRaw": "`timeout.ref()`",
              "type": "method",
              "name": "ref",
              "meta": {
                "added": [
                  "v0.9.1"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Timeout} a reference to `timeout`",
                    "name": "return",
                    "type": "Timeout",
                    "desc": "a reference to `timeout`"
                  },
                  "params": []
                }
              ],
              "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()`",
              "type": "method",
              "name": "refresh",
              "meta": {
                "added": [
                  "v10.2.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Timeout} a reference to `timeout`",
                    "name": "return",
                    "type": "Timeout",
                    "desc": "a reference to `timeout`"
                  },
                  "params": []
                }
              ],
              "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()`",
              "type": "method",
              "name": "unref",
              "meta": {
                "added": [
                  "v0.9.1"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Timeout} a reference to `timeout`",
                    "name": "return",
                    "type": "Timeout",
                    "desc": "a reference to `timeout`"
                  },
                  "params": []
                }
              ],
              "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>\n<p>Calling <code>timeout.unref()</code> creates an internal timer that will wake the Node.js\nevent loop. Creating too many of these can adversely impact performance\nof the Node.js application.</p>"
            }
          ]
        }
      ],
      "modules": [
        {
          "textRaw": "Scheduling timers",
          "name": "scheduling_timers",
          "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])`",
              "type": "method",
              "name": "setImmediate",
              "meta": {
                "added": [
                  "v0.9.1"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Immediate} for use with [`clearImmediate()`][]",
                    "name": "return",
                    "type": "Immediate",
                    "desc": "for use with [`clearImmediate()`][]"
                  },
                  "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."
                    }
                  ]
                }
              ],
              "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#errors_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=\"util.html#util_util_promisify_original\"><code>util.promisify()</code></a>:</p>\n<pre><code class=\"language-js\">const util = require('util');\nconst setImmediatePromise = util.promisify(setImmediate);\n\nsetImmediatePromise('foobar').then((value) => {\n  // value === 'foobar' (passing values is optional)\n  // This is executed after all I/O callbacks.\n});\n\n// Or with async function\nasync function timerExample() {\n  console.log('Before I/O callbacks');\n  await setImmediatePromise();\n  console.log('After I/O callbacks');\n}\ntimerExample();\n</code></pre>"
            },
            {
              "textRaw": "`setInterval(callback, delay[, ...args])`",
              "type": "method",
              "name": "setInterval",
              "meta": {
                "added": [
                  "v0.0.1"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Timeout} for use with [`clearInterval()`][]",
                    "name": "return",
                    "type": "Timeout",
                    "desc": "for use with [`clearInterval()`][]"
                  },
                  "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`.",
                      "name": "delay",
                      "type": "number",
                      "desc": "The number of milliseconds to wait before calling the `callback`."
                    },
                    {
                      "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."
                    }
                  ]
                }
              ],
              "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>, the <code>delay</code> will be\nset 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#errors_class_typeerror\"><code>TypeError</code></a> will be thrown.</p>"
            },
            {
              "textRaw": "`setTimeout(callback, delay[, ...args])`",
              "type": "method",
              "name": "setTimeout",
              "meta": {
                "added": [
                  "v0.0.1"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Timeout} for use with [`clearTimeout()`][]",
                    "name": "return",
                    "type": "Timeout",
                    "desc": "for use with [`clearTimeout()`][]"
                  },
                  "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`.",
                      "name": "delay",
                      "type": "number",
                      "desc": "The number of milliseconds to wait before calling the `callback`."
                    },
                    {
                      "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."
                    }
                  ]
                }
              ],
              "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>, 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#errors_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=\"util.html#util_util_promisify_original\"><code>util.promisify()</code></a>:</p>\n<pre><code class=\"language-js\">const util = require('util');\nconst setTimeoutPromise = util.promisify(setTimeout);\n\nsetTimeoutPromise(40, 'foobar').then((value) => {\n  // value === 'foobar' (passing values is optional)\n  // This is executed after about 40 milliseconds.\n});\n</code></pre>"
            }
          ],
          "type": "module",
          "displayName": "Scheduling timers"
        },
        {
          "textRaw": "Cancelling timers",
          "name": "cancelling_timers",
          "desc": "<p>The <a href=\"timers.html#timers_setimmediate_callback_args\"><code>setImmediate()</code></a>, <a href=\"timers.html#timers_setinterval_callback_delay_args\"><code>setInterval()</code></a>, and <a href=\"timers.html#timers_settimeout_callback_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>It is not possible to cancel timers that were created using the promisified\nvariants of <a href=\"timers.html#timers_setimmediate_callback_args\"><code>setImmediate()</code></a>, <a href=\"timers.html#timers_settimeout_callback_delay_args\"><code>setTimeout()</code></a>.</p>",
          "methods": [
            {
              "textRaw": "`clearImmediate(immediate)`",
              "type": "method",
              "name": "clearImmediate",
              "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=\"timers.html#timers_setimmediate_callback_args\"><code>setImmediate()</code></a>.</p>"
            },
            {
              "textRaw": "`clearInterval(timeout)`",
              "type": "method",
              "name": "clearInterval",
              "meta": {
                "added": [
                  "v0.0.1"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`timeout` {Timeout} A `Timeout` object as returned by [`setInterval()`][].",
                      "name": "timeout",
                      "type": "Timeout",
                      "desc": "A `Timeout` object as returned by [`setInterval()`][]."
                    }
                  ]
                }
              ],
              "desc": "<p>Cancels a <code>Timeout</code> object created by <a href=\"timers.html#timers_setinterval_callback_delay_args\"><code>setInterval()</code></a>.</p>"
            },
            {
              "textRaw": "`clearTimeout(timeout)`",
              "type": "method",
              "name": "clearTimeout",
              "meta": {
                "added": [
                  "v0.0.1"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`timeout` {Timeout} A `Timeout` object as returned by [`setTimeout()`][].",
                      "name": "timeout",
                      "type": "Timeout",
                      "desc": "A `Timeout` object as returned by [`setTimeout()`][]."
                    }
                  ]
                }
              ],
              "desc": "<p>Cancels a <code>Timeout</code> object created by <a href=\"timers.html#timers_settimeout_callback_delay_args\"><code>setTimeout()</code></a>.</p>"
            }
          ],
          "type": "module",
          "displayName": "Cancelling timers"
        }
      ],
      "type": "module",
      "displayName": "Timers"
    },
    {
      "textRaw": "TLS (SSL)",
      "name": "tls_(ssl)",
      "introduced_in": "v0.10.0",
      "stability": 2,
      "stabilityText": "Stable",
      "desc": "<p>The <code>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-js\">const tls = require('tls');\n</code></pre>",
      "modules": [
        {
          "textRaw": "TLS/SSL concepts",
          "name": "tls/ssl_concepts",
          "desc": "<p>The TLS/SSL is a public/private key infrastructure (PKI). For most common\ncases, each client and server must have a <em>private key</em>.</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/Diffie%E2%80%93Hellman_key_exchange\">DHE</a>: An ephemeral version of the Diffie Hellman key-agreement protocol.</li>\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</ul>\n<p>Ephemeral methods may have some performance drawbacks, because key generation\nis expensive.</p>\n<p>To use perfect forward secrecy using <code>DHE</code> with the <code>tls</code> module, it is required\nto generate Diffie-Hellman parameters and specify them with the <code>dhparam</code>\noption to <a href=\"tls.html#tls_tls_createsecurecontext_options\"><code>tls.createSecureContext()</code></a>. The following illustrates the use of\nthe OpenSSL command-line interface to generate such parameters:</p>\n<pre><code class=\"language-bash\">openssl dhparam -outform PEM -out dhparam.pem 2048\n</code></pre>\n<p>If using perfect forward secrecy using <code>ECDHE</code>, Diffie-Hellman parameters are\nnot required and a default ECDHE curve will be used. The <code>ecdhCurve</code> property\ncan be used when creating a TLS Server to specify the list of names of supported\ncurves to use, see <a href=\"tls.html#tls_tls_createserver_options_secureconnectionlistener\"><code>tls.createServer()</code></a> for more info.</p>\n<p>Perfect forward secrecy was optional up to TLSv1.2, but it is not optional for\nTLSv1.3, because all TLSv1.3 cipher suites use ECDHE.</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\nSSL certificates.</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 PKI\n(Public Key Infrastructure) 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 but currently only those that use SHA256 digest are\nsupported they can be retrieved via <code>openssl ciphers -v -s -tls1_3 -psk</code>.</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>"
            },
            {
              "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=\"tls.html#tls_class_tls_tlssocket\"><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/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;number&gt;</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/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;number&gt;</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",
              "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",
                  "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=\"tls.html#tls_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=\"tls.html#tls_tls_connect_options_callback\"><code>tls.connect()</code></a>\nto reuse the session. Servers must\nimplement handlers for the <a href=\"tls.html#tls_event_newsession\"><code>'newSession'</code></a> and <a href=\"tls.html#tls_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>",
                  "type": "module",
                  "displayName": "Session identifiers"
                },
                {
                  "textRaw": "Session tickets",
                  "name": "session_tickets",
                  "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 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=\"tls.html#tls_tlssocket_gettlsticket\"><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=\"tls.html#tls_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>Its possible to get the ticket keys by calling <a href=\"tls.html#tls_server_getticketkeys\"><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=\"tls.html#tls_tls_createserver_options_secureconnectionlistener\"><code>tls.createServer()</code></a>. The keys should be regularly\nregenerated and server's keys can be reset with\n<a href=\"tls.html#tls_server_setticketkeys_keys\"><code>server.setTicketKeys()</code></a>.</p>\n<p>Session ticket keys are cryptographic keys, and they <strong><em>must be stored\nsecurely</em></strong>. 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('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=\"tls.html#tls_tls_createserver_options_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-console\">$ 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>",
                  "type": "module",
                  "displayName": "Session tickets"
                }
              ],
              "type": "module",
              "displayName": "Session resumption"
            }
          ],
          "type": "module",
          "displayName": "TLS/SSL concepts"
        },
        {
          "textRaw": "Modifying the default TLS cipher suite",
          "name": "modifying_the_default_tls_cipher_suite",
          "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#cli_tls_cipher_list_list\"><code>--tls-cipher-list</code></a> command\nline switch (directly, or via the <a href=\"cli.html#cli_node_options_options\"><code>NODE_OPTIONS</code></a> environment variable). For\ninstance, the following makes <code>ECDHE-RSA-AES128-GCM-SHA256:!RC4</code> the default TLS\ncipher 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>The default can also be replaced on a per client or server basis using the\n<code>ciphers</code> option from <a href=\"tls.html#tls_tls_createsecurecontext_options\"><code>tls.createSecureContext()</code></a>, which is also available\nin <a href=\"tls.html#tls_tls_createserver_options_secureconnectionlistener\"><code>tls.createServer()</code></a>, <a href=\"tls.html#tls_tls_connect_options_callback\"><code>tls.connect()</code></a>, and when creating new\n<a href=\"tls.html#tls_class_tls_tlssocket\"><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>128 bit AES is preferred over 192 and 256 bit AES in light of <a href=\"https://www.schneier.com/blog/archives/2009/07/another_new_aes.html\">specific\nattacks affecting larger AES key sizes</a>.</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 5 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 3 are enabled by default. The last 2 <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>",
          "type": "module",
          "displayName": "Modifying the default TLS cipher suite"
        },
        {
          "textRaw": "Deprecated APIs",
          "name": "deprecated_apis",
          "classes": [
            {
              "textRaw": "Class: `CryptoStream`",
              "type": "class",
              "name": "CryptoStream",
              "meta": {
                "added": [
                  "v0.3.4"
                ],
                "deprecated": [
                  "v0.11.3"
                ],
                "changes": []
              },
              "stability": 0,
              "stabilityText": "Deprecated: Use [`tls.TLSSocket`][] instead.",
              "desc": "<p>The <code>tls.CryptoStream</code> class represents a stream of encrypted data. This class\nis deprecated and should no longer be used.</p>",
              "properties": [
                {
                  "textRaw": "`cryptoStream.bytesWritten`",
                  "name": "bytesWritten",
                  "meta": {
                    "added": [
                      "v0.3.4"
                    ],
                    "deprecated": [
                      "v0.11.3"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The <code>cryptoStream.bytesWritten</code> property returns the total number of bytes\nwritten to the underlying socket <em>including</em> the bytes required for the\nimplementation of the TLS protocol.</p>"
                }
              ]
            },
            {
              "textRaw": "Class: `SecurePair`",
              "type": "class",
              "name": "SecurePair",
              "meta": {
                "added": [
                  "v0.3.2"
                ],
                "deprecated": [
                  "v0.11.3"
                ],
                "changes": []
              },
              "stability": 0,
              "stabilityText": "Deprecated: Use [`tls.TLSSocket`][] instead.",
              "desc": "<p>Returned by <a href=\"tls.html#tls_tls_createsecurepair_context_isserver_requestcert_rejectunauthorized_options\"><code>tls.createSecurePair()</code></a>.</p>",
              "events": [
                {
                  "textRaw": "Event: `'secure'`",
                  "type": "event",
                  "name": "secure",
                  "meta": {
                    "added": [
                      "v0.3.2"
                    ],
                    "deprecated": [
                      "v0.11.3"
                    ],
                    "changes": []
                  },
                  "params": [],
                  "desc": "<p>The <code>'secure'</code> event is emitted by the <code>SecurePair</code> object once a secure\nconnection has been established.</p>\n<p>As with checking for the server\n<a href=\"tls.html#tls_event_secureconnection\"><code>'secureConnection'</code></a>\nevent, <code>pair.cleartext.authorized</code> should be inspected to confirm whether the\ncertificate used is properly authorized.</p>"
                }
              ]
            }
          ],
          "methods": [
            {
              "textRaw": "`tls.createSecurePair([context][, isServer][, requestCert][, rejectUnauthorized][, options])`",
              "type": "method",
              "name": "createSecurePair",
              "meta": {
                "added": [
                  "v0.3.2"
                ],
                "deprecated": [
                  "v0.11.3"
                ],
                "changes": [
                  {
                    "version": "v5.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/2564",
                    "description": "ALPN options are supported now."
                  }
                ]
              },
              "stability": 0,
              "stabilityText": "Deprecated: Use [`tls.TLSSocket`][] instead.",
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`context` {Object} A secure context object as returned by `tls.createSecureContext()`",
                      "name": "context",
                      "type": "Object",
                      "desc": "A secure context object as returned by `tls.createSecureContext()`"
                    },
                    {
                      "textRaw": "`isServer` {boolean} `true` to specify that this TLS connection should be opened as a server.",
                      "name": "isServer",
                      "type": "boolean",
                      "desc": "`true` to specify that this TLS connection should be opened as a server."
                    },
                    {
                      "textRaw": "`requestCert` {boolean} `true` to specify whether a server should request a certificate from a connecting client. Only applies when `isServer` is `true`.",
                      "name": "requestCert",
                      "type": "boolean",
                      "desc": "`true` to specify whether a server should request a certificate from a connecting client. Only applies when `isServer` is `true`."
                    },
                    {
                      "textRaw": "`rejectUnauthorized` {boolean} If not `false` a server automatically reject clients with invalid certificates. Only applies when `isServer` is `true`.",
                      "name": "rejectUnauthorized",
                      "type": "boolean",
                      "desc": "If not `false` a server automatically reject clients with invalid certificates. Only applies when `isServer` is `true`."
                    },
                    {
                      "textRaw": "`options`",
                      "name": "options",
                      "options": [
                        {
                          "textRaw": "`enableTrace`: See [`tls.createServer()`][]",
                          "name": "enableTrace",
                          "desc": "See [`tls.createServer()`][]"
                        },
                        {
                          "textRaw": "`secureContext`: A TLS context object from [`tls.createSecureContext()`][]",
                          "name": "secureContext",
                          "desc": "A TLS context object from [`tls.createSecureContext()`][]"
                        },
                        {
                          "textRaw": "`isServer`: If `true` the TLS socket will be instantiated in server-mode. **Default:** `false`.",
                          "name": "isServer",
                          "default": "`false`",
                          "desc": "If `true` the TLS socket will be instantiated in server-mode."
                        },
                        {
                          "textRaw": "`server` {net.Server} A [`net.Server`][] instance",
                          "name": "server",
                          "type": "net.Server",
                          "desc": "A [`net.Server`][] instance"
                        },
                        {
                          "textRaw": "`requestCert`: See [`tls.createServer()`][]",
                          "name": "requestCert",
                          "desc": "See [`tls.createServer()`][]"
                        },
                        {
                          "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": "`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."
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Creates a new secure pair object with two streams, one of which reads and writes\nthe encrypted data and the other of which reads and writes the cleartext data.\nGenerally, the encrypted stream is piped to/from an incoming encrypted data\nstream and the cleartext one is used as a replacement for the initial encrypted\nstream.</p>\n<p><code>tls.createSecurePair()</code> returns a <code>tls.SecurePair</code> object with <code>cleartext</code> and\n<code>encrypted</code> stream properties.</p>\n<p>Using <code>cleartext</code> has the same API as <a href=\"tls.html#tls_class_tls_tlssocket\"><code>tls.TLSSocket</code></a>.</p>\n<p>The <code>tls.createSecurePair()</code> method is now deprecated in favor of\n<code>tls.TLSSocket()</code>. For example, the code:</p>\n<pre><code class=\"language-js\">pair = tls.createSecurePair(/* ... */);\npair.encrypted.pipe(socket);\nsocket.pipe(pair.encrypted);\n</code></pre>\n<p>can be replaced by:</p>\n<pre><code class=\"language-js\">secureSocket = tls.TLSSocket(socket, options);\n</code></pre>\n<p>where <code>secureSocket</code> has the same API as <code>pair.cleartext</code>.</p>"
            }
          ],
          "type": "module",
          "displayName": "Deprecated APIs"
        }
      ],
      "classes": [
        {
          "textRaw": "Class: `tls.Server`",
          "type": "class",
          "name": "tls.Server",
          "meta": {
            "added": [
              "v0.3.2"
            ],
            "changes": []
          },
          "desc": "<ul>\n<li>Extends: <a href=\"net.html#net_class_net_server\" class=\"type\">&lt;net.Server&gt;</a></li>\n</ul>\n<p>Accepts encrypted connections using TLS or SSL.</p>",
          "events": [
            {
              "textRaw": "Event: `'keylog'`",
              "type": "event",
              "name": "keylog",
              "meta": {
                "added": [
                  "v12.3.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'`",
              "type": "event",
              "name": "newSession",
              "meta": {
                "added": [
                  "v0.9.2"
                ],
                "changes": []
              },
              "params": [],
              "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=\"tls.html#tls_event_resumesession\"><code>'resumeSession'</code></a> callback.</p>\n<p>The listener callback is passed three arguments when called:</p>\n<ul>\n<li><code>sessionId</code> <a href=\"buffer.html#buffer_class_buffer\" class=\"type\">&lt;Buffer&gt;</a> The TLS session identifier</li>\n<li><code>sessionData</code> <a href=\"buffer.html#buffer_class_buffer\" class=\"type\">&lt;Buffer&gt;</a> The TLS session data</li>\n<li><code>callback</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function\" class=\"type\">&lt;Function&gt;</a> A callback function taking no arguments that must be\ninvoked in order for data to be sent or received over the secure connection.</li>\n</ul>\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'`",
              "type": "event",
              "name": "OCSPRequest",
              "meta": {
                "added": [
                  "v0.11.13"
                ],
                "changes": []
              },
              "params": [],
              "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<ul>\n<li><code>certificate</code> <a href=\"buffer.html#buffer_class_buffer\" class=\"type\">&lt;Buffer&gt;</a> The server certificate</li>\n<li><code>issuer</code> <a href=\"buffer.html#buffer_class_buffer\" class=\"type\">&lt;Buffer&gt;</a> The issuer's certificate</li>\n<li><code>callback</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function\" class=\"type\">&lt;Function&gt;</a> A callback function that must be invoked to provide\nthe results of the OCSP request.</li>\n</ul>\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'`",
              "type": "event",
              "name": "resumeSession",
              "meta": {
                "added": [
                  "v0.9.2"
                ],
                "changes": []
              },
              "params": [],
              "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<ul>\n<li><code>sessionId</code> <a href=\"buffer.html#buffer_class_buffer\" class=\"type\">&lt;Buffer&gt;</a> The TLS session identifier</li>\n<li>\n<p><code>callback</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function\" class=\"type\">&lt;Function&gt;</a> A callback function to be called when the prior session\nhas been recovered: <code>callback([err[, sessionData]])</code></p>\n<ul>\n<li><code>err</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error\" class=\"type\">&lt;Error&gt;</a></li>\n<li><code>sessionData</code> <a href=\"buffer.html#buffer_class_buffer\" class=\"type\">&lt;Buffer&gt;</a></li>\n</ul>\n</li>\n</ul>\n<p>The event listener should perform a lookup in external storage for the\n<code>sessionData</code> saved by the <a href=\"tls.html#tls_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'`",
              "type": "event",
              "name": "secureConnection",
              "meta": {
                "added": [
                  "v0.3.2"
                ],
                "changes": []
              },
              "params": [],
              "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<ul>\n<li><code>tlsSocket</code> <a href=\"tls.html#tls_class_tls_tlssocket\" class=\"type\">&lt;tls.TLSSocket&gt;</a> The established TLS socket.</li>\n</ul>\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, <code>tlsSocket.alpnProtocol</code>\nequals <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'`",
              "type": "event",
              "name": "tlsClientError",
              "meta": {
                "added": [
                  "v6.0.0"
                ],
                "changes": []
              },
              "params": [],
              "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>\n<ul>\n<li><code>exception</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error\" class=\"type\">&lt;Error&gt;</a> The <code>Error</code> object describing the error</li>\n<li><code>tlsSocket</code> <a href=\"tls.html#tls_class_tls_tlssocket\" class=\"type\">&lt;tls.TLSSocket&gt;</a> The <code>tls.TLSSocket</code> instance from which the\nerror originated.</li>\n</ul>"
            }
          ],
          "methods": [
            {
              "textRaw": "`server.addContext(hostname, context)`",
              "type": "method",
              "name": "addContext",
              "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} An object containing any of the possible properties from the [`tls.createSecureContext()`][] `options` arguments (e.g. `key`, `cert`, `ca`, etc).",
                      "name": "context",
                      "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.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>"
            },
            {
              "textRaw": "`server.address()`",
              "type": "method",
              "name": "address",
              "meta": {
                "added": [
                  "v0.6.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Object}",
                    "name": "return",
                    "type": "Object"
                  },
                  "params": []
                }
              ],
              "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#net_server_address\"><code>net.Server.address()</code></a> for\nmore information.</p>"
            },
            {
              "textRaw": "`server.close([callback])`",
              "type": "method",
              "name": "close",
              "meta": {
                "added": [
                  "v0.3.2"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {tls.Server}",
                    "name": "return",
                    "type": "tls.Server"
                  },
                  "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."
                    }
                  ]
                }
              ],
              "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()`",
              "type": "method",
              "name": "getTicketKeys",
              "meta": {
                "added": [
                  "v3.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "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."
                  },
                  "params": []
                }
              ],
              "desc": "<p>Returns the session ticket keys.</p>\n<p>See <a href=\"tls.html#tls_session_resumption\">Session Resumption</a> for more information.</p>"
            },
            {
              "textRaw": "`server.listen()`",
              "type": "method",
              "name": "listen",
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Starts the server listening for encrypted connections.\nThis method is identical to <a href=\"net.html#net_server_listen\"><code>server.listen()</code></a> from <a href=\"net.html#net_class_net_server\"><code>net.Server</code></a>.</p>"
            },
            {
              "textRaw": "`server.setSecureContext(options)`",
              "type": "method",
              "name": "setSecureContext",
              "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)`",
              "type": "method",
              "name": "setTicketKeys",
              "meta": {
                "added": [
                  "v3.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`keys` {Buffer} A 48-byte buffer containing the session ticket keys.",
                      "name": "keys",
                      "type": "Buffer",
                      "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=\"tls.html#tls_session_resumption\">Session Resumption</a> for more information.</p>"
            }
          ],
          "properties": [
            {
              "textRaw": "`connections` {number}",
              "type": "number",
              "name": "connections",
              "meta": {
                "added": [
                  "v0.3.2"
                ],
                "deprecated": [
                  "v0.9.7"
                ],
                "changes": []
              },
              "stability": 0,
              "stabilityText": "Deprecated: Use [`server.getConnections()`][] instead.",
              "desc": "<p>Returns the current number of concurrent connections on the server.</p>"
            }
          ]
        },
        {
          "textRaw": "Class: `tls.TLSSocket`",
          "type": "class",
          "name": "tls.TLSSocket",
          "meta": {
            "added": [
              "v0.11.4"
            ],
            "changes": []
          },
          "desc": "<ul>\n<li>Extends: <a href=\"net.html#net_class_net_socket\" class=\"type\">&lt;net.Socket&gt;</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\">Stream</a> interface.</p>\n<p>Methods that return TLS connection metadata (e.g.\n<a href=\"tls.html#tls_tlssocket_getpeercertificate_detailed\"><code>tls.TLSSocket.getPeerCertificate()</code></a> will only return data while the\nconnection is open.</p>",
          "events": [
            {
              "textRaw": "Event: `'keylog'`",
              "type": "event",
              "name": "keylog",
              "meta": {
                "added": [
                  "v12.3.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'`",
              "type": "event",
              "name": "OCSPResponse",
              "meta": {
                "added": [
                  "v0.11.13"
                ],
                "changes": []
              },
              "params": [],
              "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<ul>\n<li><code>response</code> <a href=\"buffer.html#buffer_class_buffer\" class=\"type\">&lt;Buffer&gt;</a> The server's OCSP response</li>\n</ul>\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: `'secureConnect'`",
              "type": "event",
              "name": "secureConnect",
              "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>"
            },
            {
              "textRaw": "Event: `'session'`",
              "type": "event",
              "name": "session",
              "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=\"tls.html#tls_tls_connect_options_callback\"><code>tls.connect()</code></a> to resume the connection.</p>\n<p>See <a href=\"tls.html#tls_session_resumption\">Session Resumption</a> for more information.</p>\n<p>For TLSv1.2 and below, <a href=\"tls.html#tls_tlssocket_getsession\"><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()`",
              "type": "method",
              "name": "address",
              "meta": {
                "added": [
                  "v0.11.4"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Object}",
                    "name": "return",
                    "type": "Object"
                  },
                  "params": []
                }
              ],
              "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()`",
              "type": "method",
              "name": "disableRenegotiation",
              "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()`",
              "type": "method",
              "name": "enableTrace",
              "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>Note: The format of the output is identical to the output of <code>openssl s_client -trace</code> or <code>openssl s_server -trace</code>. While it is produced by OpenSSL's\n<code>SSL_trace()</code> function, the format is undocumented, can change without notice,\nand should not be relied on.</p>"
            },
            {
              "textRaw": "`tlsSocket.getCertificate()`",
              "type": "method",
              "name": "getCertificate",
              "meta": {
                "added": [
                  "v11.2.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Object}",
                    "name": "return",
                    "type": "Object"
                  },
                  "params": []
                }
              ],
              "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=\"tls.html#tls_tlssocket_getpeercertificate_detailed\"><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()`",
              "type": "method",
              "name": "getCipher",
              "meta": {
                "added": [
                  "v0.11.4"
                ],
                "changes": [
                  {
                    "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'`)."
                  },
                  {
                    "version": "v12.16.0",
                    "pr-url": "https://github.com/nodejs/node/pull/30637",
                    "description": "Return the IETF cipher name as `standardName`."
                  }
                ]
              },
              "signatures": [
                {
                  "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.",
                        "name": "version",
                        "type": "string",
                        "desc": "The minimum TLS protocol version supported by this cipher suite."
                      }
                    ]
                  },
                  "params": []
                }
              ],
              "desc": "<p>Returns an object containing information on the negotiated cipher suite.</p>\n<p>For example:</p>\n<pre><code class=\"language-json\">{\n    \"name\": \"AES128-SHA256\",\n    \"standardName\": \"TLS_RSA_WITH_AES_128_CBC_SHA256\",\n    \"version\": \"TLSv1.2\"\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()`",
              "type": "method",
              "name": "getEphemeralKeyInfo",
              "meta": {
                "added": [
                  "v5.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Object}",
                    "name": "return",
                    "type": "Object"
                  },
                  "params": []
                }
              ],
              "desc": "<p>Returns an object representing the type, name, and size of parameter of\nan ephemeral key exchange in <a href=\"tls.html#tls_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()`",
              "type": "method",
              "name": "getFinished",
              "meta": {
                "added": [
                  "v9.9.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Buffer|undefined} The latest `Finished` message that has been sent to the socket as part of a 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 a SSL/TLS handshake, or `undefined` if no `Finished` message has been sent yet."
                  },
                  "params": []
                }
              ],
              "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])`",
              "type": "method",
              "name": "getPeerCertificate",
              "meta": {
                "added": [
                  "v0.11.4"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Object} A certificate object.",
                    "name": "return",
                    "type": "Object",
                    "desc": "A certificate object."
                  },
                  "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."
                    }
                  ]
                }
              ],
              "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",
                  "meta": {
                    "changes": [
                      {
                        "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>raw</code> <a href=\"buffer.html#buffer_class_buffer\" class=\"type\">&lt;Buffer&gt;</a> The DER encoded X.509 certificate data.</li>\n<li><code>subject</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object\" class=\"type\">&lt;Object&gt;</a> The certificate subject, described in terms of\n Country (<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/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object\" class=\"type\">&lt;Object&gt;</a> The certificate issuer, described in the same terms as the\n <code>subject</code>.</li>\n<li><code>valid_from</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string&gt;</a> The date-time the certificate is valid from.</li>\n<li><code>valid_to</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string&gt;</a> The date-time the certificate is valid to.</li>\n<li><code>serialNumber</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string&gt;</a> The certificate serial number, as a hex string.\n Example: <code>'B9B0D332A1AA5635'</code>.</li>\n<li><code>fingerprint</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string&gt;</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/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string&gt;</a> The SHA-256 digest of the DER encoded certificate.\n It 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/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array\" class=\"type\">&lt;Array&gt;</a> (Optional) The extended key usage, a set of OIDs.</li>\n<li><code>subjectaltname</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string&gt;</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/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array\" class=\"type\">&lt;Array&gt;</a> (Optional) An array describing the AuthorityInfoAccess,\n used with OCSP.</li>\n<li><code>issuerCertificate</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object\" class=\"type\">&lt;Object&gt;</a> (Optional) The issuer certificate object. For\n self-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/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;number&gt;</a> The RSA bit size. Example: <code>1024</code>.</li>\n<li><code>exponent</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string&gt;</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/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string&gt;</a> The RSA modulus, as a hexadecimal string. Example:\n <code>'B56CE45CB7...'</code>.</li>\n<li><code>pubkey</code> <a href=\"buffer.html#buffer_class_buffer\" class=\"type\">&lt;Buffer&gt;</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#buffer_class_buffer\" class=\"type\">&lt;Buffer&gt;</a> The public key.</li>\n<li><code>bits</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;number&gt;</a> The key size in bits. Example: <code>256</code>.</li>\n<li><code>asn1Curve</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string&gt;</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/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string&gt;</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:\n<code>'P-256'</code>.</li>\n</ul>\n<p>Example certificate:</p>\n<pre><code class=\"language-text\">{ 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  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>",
                  "type": "module",
                  "displayName": "Certificate object"
                }
              ]
            },
            {
              "textRaw": "`tlsSocket.getPeerFinished()`",
              "type": "method",
              "name": "getPeerFinished",
              "meta": {
                "added": [
                  "v9.9.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Buffer|undefined} The latest `Finished` message that is expected or has actually been received from the socket as part of a 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 a SSL/TLS handshake, or `undefined` if there is no `Finished` message so far."
                  },
                  "params": []
                }
              ],
              "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.getProtocol()`",
              "type": "method",
              "name": "getProtocol",
              "meta": {
                "added": [
                  "v5.7.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {string|null}",
                    "name": "return",
                    "type": "string|null"
                  },
                  "params": []
                }
              ],
              "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()`",
              "type": "method",
              "name": "getSession",
              "meta": {
                "added": [
                  "v0.11.4"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "{Buffer}",
                      "type": "Buffer"
                    }
                  ]
                }
              ],
              "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=\"tls.html#tls_tls_connect_options_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=\"tls.html#tls_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=\"tls.html#tls_event_session\"><code>'session'</code></a> event (it also works for TLSv1.2 and below).</p>"
            },
            {
              "textRaw": "`tlsSocket.getSharedSigalgs()`",
              "type": "method",
              "name": "getSharedSigalgs",
              "meta": {
                "added": [
                  "v12.11.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "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."
                  },
                  "params": []
                }
              ],
              "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.exportKeyingMaterial(length, label[, context])`",
              "type": "method",
              "name": "exportKeyingMaterial",
              "meta": {
                "added": [
                  "v12.17.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Buffer} requested bytes of the keying material",
                    "name": "return",
                    "type": "Buffer",
                    "desc": "requested bytes of the keying material"
                  },
                  "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](https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#exporter-labels).",
                      "name": "label",
                      "type": "string",
                      "desc": "an application specific label, typically this will be a value from the [IANA Exporter Label Registry](https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#exporter-labels)."
                    },
                    {
                      "textRaw": "`context` {Buffer} Optionally provide a context.",
                      "name": "context",
                      "type": "Buffer",
                      "desc": "Optionally provide a context."
                    }
                  ]
                }
              ],
              "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.getTLSTicket()`",
              "type": "method",
              "name": "getTLSTicket",
              "meta": {
                "added": [
                  "v0.11.4"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "{Buffer}",
                      "type": "Buffer"
                    }
                  ]
                }
              ],
              "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=\"tls.html#tls_session_resumption\">Session Resumption</a> for more information.</p>"
            },
            {
              "textRaw": "`tlsSocket.isSessionReused()`",
              "type": "method",
              "name": "isSessionReused",
              "meta": {
                "added": [
                  "v0.5.6"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "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."
                  },
                  "params": []
                }
              ],
              "desc": "<p>See <a href=\"tls.html#tls_session_resumption\">Session Resumption</a> for more information.</p>"
            },
            {
              "textRaw": "`tlsSocket.renegotiate(options, callback)`",
              "type": "method",
              "name": "renegotiate",
              "meta": {
                "added": [
                  "v0.11.8"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {boolean} `true` if renegotiation was initiated, `false` otherwise.",
                    "name": "return",
                    "type": "boolean",
                    "desc": "`true` if renegotiation was initiated, `false` otherwise."
                  },
                  "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."
                    }
                  ]
                }
              ],
              "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.setMaxSendFragment(size)`",
              "type": "method",
              "name": "setMaxSendFragment",
              "meta": {
                "added": [
                  "v0.11.11"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  },
                  "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`."
                    }
                  ]
                }
              ],
              "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",
              "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": "`authorized` Returns: {boolean}",
              "type": "boolean",
              "name": "return",
              "meta": {
                "added": [
                  "v0.11.4"
                ],
                "changes": []
              },
              "desc": "<p>Returns <code>true</code> if the peer certificate was signed by one of the CAs specified\nwhen creating the <code>tls.TLSSocket</code> instance, otherwise <code>false</code>.</p>"
            },
            {
              "textRaw": "`tlsSocket.encrypted`",
              "name": "encrypted",
              "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": "`localAddress` {string}",
              "type": "string",
              "name": "localAddress",
              "meta": {
                "added": [
                  "v0.11.4"
                ],
                "changes": []
              },
              "desc": "<p>Returns the string representation of the local IP address.</p>"
            },
            {
              "textRaw": "`localPort` {number}",
              "type": "number",
              "name": "localPort",
              "meta": {
                "added": [
                  "v0.11.4"
                ],
                "changes": []
              },
              "desc": "<p>Returns the numeric representation of the local port.</p>"
            },
            {
              "textRaw": "`remoteAddress` {string}",
              "type": "string",
              "name": "remoteAddress",
              "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": "`remoteFamily` {string}",
              "type": "string",
              "name": "remoteFamily",
              "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": "`remotePort` {number}",
              "type": "number",
              "name": "remotePort",
              "meta": {
                "added": [
                  "v0.11.4"
                ],
                "changes": []
              },
              "desc": "<p>Returns the numeric representation of the remote port. For example, <code>443</code>.</p>"
            }
          ],
          "signatures": [
            {
              "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": "`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."
                    }
                  ]
                }
              ],
              "desc": "<p>Construct a new <code>tls.TLSSocket</code> object from an existing TCP socket.</p>"
            }
          ]
        }
      ],
      "methods": [
        {
          "textRaw": "`tls.checkServerIdentity(hostname, cert)`",
          "type": "method",
          "name": "checkServerIdentity",
          "meta": {
            "added": [
              "v0.8.4"
            ],
            "changes": []
          },
          "signatures": [
            {
              "return": {
                "textRaw": "Returns: {Error|undefined}",
                "name": "return",
                "type": "Error|undefined"
              },
              "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."
                }
              ]
            }
          ],
          "desc": "<p>Verifies the certificate <code>cert</code> is issued to <code>hostname</code>.</p>\n<p>Returns <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error\" class=\"type\">&lt;Error&gt;</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/en-US/docs/Web/JavaScript/Data_structures#Undefined_type\" class=\"type\">&lt;undefined&gt;</a>.</p>\n<p>This function can be overwritten by providing alternative function as part of\nthe <code>options.checkServerIdentity</code> option 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>"
        },
        {
          "textRaw": "`tls.connect(options[, callback])`",
          "type": "method",
          "name": "connect",
          "meta": {
            "added": [
              "v0.11.3"
            ],
            "changes": [
              {
                "version": "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",
                "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": [
            {
              "return": {
                "textRaw": "Returns: {tls.TLSSocket}",
                "name": "return",
                "type": "tls.TLSSocket"
              },
              "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 the `socket` option is missing, indicates whether or not to allow the internally created socket to be half-open, otherwise the option is ignored. See the `allowHalfOpen` option of [`net.Socket`][] for details. **Default:** `false`.",
                      "name": "allowHalfOpen",
                      "type": "boolean",
                      "default": "`false`",
                      "desc": "If the `socket` option is missing, indicates whether or not to allow the internally created socket to be half-open, otherwise the option is ignored. 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}",
                      "name": "pskCallback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "hint: {string} optional message sent from the server to help client decide which identity to use during negotiation. Always `null` if TLS 1.3 is used.",
                          "name": "hint",
                          "type": "string",
                          "desc": "optional message sent from the server to help client decide which identity to use during negotiation. Always `null` if TLS 1.3 is used."
                        },
                        {
                          "textRaw": "Returns: {Object} in the form `{ psk: <Buffer|TypedArray|DataView>, identity: <string> }` or `null` to stop the negotiation process. `psk` must be compatible with the selected cipher's digest. `identity` must use UTF-8 encoding. When negotiating TLS-PSK (pre-shared keys), this function is called with optional identity `hint` provided by the server or `null` in case of TLS 1.3 where `hint` was removed. It will be necessary to provide a custom `tls.checkServerIdentity()` for the connection as the default one will try to check host name/IP of the server against the certificate but that's not applicable for PSK because there won't be a certificate present. More information can be found in the [RFC 4279][].",
                          "name": "return",
                          "type": "Object",
                          "desc": "in the form `{ psk: <Buffer|TypedArray|DataView>, identity: <string> }` or `null` to stop the negotiation process. `psk` must be compatible with the selected cipher's digest. `identity` must use UTF-8 encoding. When negotiating TLS-PSK (pre-shared keys), this function is called with optional identity `hint` provided by the server or `null` in case of TLS 1.3 where `hint` was removed. It will be necessary to provide a custom `tls.checkServerIdentity()` for the connection as the default one will try to check host name/IP of the server against the certificate but that's not applicable for PSK because there won't be a certificate present. More information can be found in the [RFC 4279][]."
                        }
                      ]
                    },
                    {
                      "textRaw": "`ALPNProtocols`: {string[]|Buffer[]|TypedArray[]|DataView[]|Buffer| TypedArray|DataView} An array of strings, `Buffer`s or `TypedArray`s or `DataView`s, or a single `Buffer` or `TypedArray` or `DataView` containing the supported ALPN protocols. `Buffer`s 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[]|Buffer| TypedArray|DataView",
                      "desc": "An array of strings, `Buffer`s or `TypedArray`s or `DataView`s, or a single `Buffer` or `TypedArray` or `DataView` containing the supported ALPN protocols. `Buffer`s 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": "`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": "`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."
                    },
                    {
                      "textRaw": "...: Any [`socket.connect()`][] option not already listed.",
                      "name": "...",
                      "desc": "Any [`socket.connect()`][] option not already listed."
                    }
                  ]
                },
                {
                  "textRaw": "`callback` {Function}",
                  "name": "callback",
                  "type": "Function"
                }
              ]
            }
          ],
          "desc": "<p>The <code>callback</code> function, if specified, will be added as a listener for the\n<a href=\"tls.html#tls_event_secureconnect\"><code>'secureConnect'</code></a> event.</p>\n<p><code>tls.connect()</code> returns a <a href=\"tls.html#tls_class_tls_tlssocket\"><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=\"tls.html#tls_tls_createserver_options_secureconnectionlistener\"><code>tls.createServer()</code></a>:</p>\n<pre><code class=\"language-js\">// Assumes an echo server that is listening on port 8000.\nconst tls = require('tls');\nconst fs = require('fs');\n\nconst options = {\n  // Necessary only if the server requires client certificate authentication.\n  key: fs.readFileSync('client-key.pem'),\n  cert: fs.readFileSync('client-cert.pem'),\n\n  // Necessary only if the server uses a self-signed certificate.\n  ca: [ fs.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 = tls.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>"
        },
        {
          "textRaw": "`tls.connect(path[, options][, callback])`",
          "type": "method",
          "name": "connect",
          "meta": {
            "added": [
              "v0.11.3"
            ],
            "changes": []
          },
          "signatures": [
            {
              "return": {
                "textRaw": "Returns: {tls.TLSSocket}",
                "name": "return",
                "type": "tls.TLSSocket"
              },
              "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()`][]."
                },
                {
                  "textRaw": "`callback` {Function} See [`tls.connect()`][].",
                  "name": "callback",
                  "type": "Function",
                  "desc": "See [`tls.connect()`][]."
                }
              ]
            }
          ],
          "desc": "<p>Same as <a href=\"tls.html#tls_tls_connect_options_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])`",
          "type": "method",
          "name": "connect",
          "meta": {
            "added": [
              "v0.11.3"
            ],
            "changes": []
          },
          "signatures": [
            {
              "return": {
                "textRaw": "Returns: {tls.TLSSocket}",
                "name": "return",
                "type": "tls.TLSSocket"
              },
              "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`."
                },
                {
                  "textRaw": "`options` {Object} See [`tls.connect()`][].",
                  "name": "options",
                  "type": "Object",
                  "desc": "See [`tls.connect()`][]."
                },
                {
                  "textRaw": "`callback` {Function} See [`tls.connect()`][].",
                  "name": "callback",
                  "type": "Function",
                  "desc": "See [`tls.connect()`][]."
                }
              ]
            }
          ],
          "desc": "<p>Same as <a href=\"tls.html#tls_tls_connect_options_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])`",
          "type": "method",
          "name": "createSecureContext",
          "meta": {
            "added": [
              "v0.11.13"
            ],
            "changes": [
              {
                "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",
                "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": "`ca` {string|string[]|Buffer|Buffer[]} Optionally override the trusted CA certificates. Default is to trust the well-known CAs curated by Mozilla. Mozilla's CAs are completely replaced when CAs are explicitly specified using this option. 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\". See also [`tls.rootCertificates`][].",
                      "name": "ca",
                      "type": "string|string[]|Buffer|Buffer[]",
                      "desc": "Optionally override the trusted CA certificates. Default is to trust the well-known CAs curated by Mozilla. Mozilla's CAs are completely replaced when CAs are explicitly specified using this option. 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\". See also [`tls.rootCertificates`][]."
                    },
                    {
                      "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](https://www.openssl.org/docs/man1.1.1/man3/SSL_CTX_set1_sigalgs_list.html) 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](https://www.openssl.org/docs/man1.1.1/man3/SSL_CTX_set1_sigalgs_list.html) for more info."
                    },
                    {
                      "textRaw": "`ciphers` {string} Cipher suite specification, replacing the default. For more information, see [modifying the default 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 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.",
                      "name": "clientCertEngine",
                      "type": "string",
                      "desc": "Name of an OpenSSL engine which can provide the client certificate."
                    },
                    {
                      "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} Diffie Hellman parameters, required for [perfect forward secrecy][]. Use `openssl dhparam` to create the parameters. The key length must be greater than or equal to 1024 bits or else an error will be thrown. Although 1024 bits is permissible, use 2048 bits or larger for stronger security. If omitted or invalid, the parameters are silently discarded and DHE ciphers will not be available.",
                      "name": "dhparam",
                      "type": "string|Buffer",
                      "desc": "Diffie Hellman parameters, required for [perfect forward secrecy][]. Use `openssl dhparam` to create the parameters. The key length must be greater than or equal to 1024 bits or else an error will be thrown. Although 1024 bits is permissible, use 2048 bits or larger for stronger security. If omitted or invalid, the parameters are silently discarded and DHE ciphers will not 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`.",
                      "name": "privateKeyEngine",
                      "type": "string",
                      "desc": "Name of an OpenSSL engine to get private key from. Should be used together with `privateKeyIdentifier`."
                    },
                    {
                      "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.",
                      "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."
                    },
                    {
                      "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. It is not recommended to use less than TLSv1.2, but it may be required for interoperability. **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. It is not recommended to use less than TLSv1.2, but it may be required for interoperability."
                    },
                    {
                      "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."
                    }
                  ]
                }
              ]
            }
          ],
          "desc": "<p><a href=\"tls.html#tls_tls_createserver_options_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=\"tls.html#tls_tls_createserver_options_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=\"tls.html#tls_tls_createserver_options_secureconnectionlistener\"><code>tls.createServer()</code></a>\nand <a href=\"tls.html#tls_server_addcontext_hostname_context\"><code>server.addContext()</code></a>, but has no public methods.</p>\n<p>A key is <em>required</em> for ciphers that make use of 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>"
        },
        {
          "textRaw": "`tls.createServer([options][, secureConnectionListener])`",
          "type": "method",
          "name": "createServer",
          "meta": {
            "added": [
              "v0.3.2"
            ],
            "changes": [
              {
                "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": [
            {
              "return": {
                "textRaw": "Returns: {tls.Server}",
                "name": "return",
                "type": "tls.Server"
              },
              "params": [
                {
                  "textRaw": "`options` {Object}",
                  "name": "options",
                  "type": "Object",
                  "options": [
                    {
                      "textRaw": "`ALPNProtocols`: {string[]|Buffer[]|TypedArray[]|DataView[]|Buffer| TypedArray|DataView} An array of strings, `Buffer`s or `TypedArray`s or `DataView`s, or a single `Buffer` or `TypedArray` or `DataView` containing the supported ALPN protocols. `Buffer`s 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[]|Buffer| TypedArray|DataView",
                      "desc": "An array of strings, `Buffer`s or `TypedArray`s or `DataView`s, or a single `Buffer` or `TypedArray` or `DataView` containing the supported ALPN protocols. `Buffer`s 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": "`clientCertEngine` {string} Name of an OpenSSL engine which can provide the client certificate.",
                      "name": "clientCertEngine",
                      "type": "string",
                      "desc": "Name of an OpenSSL engine which can provide the client certificate."
                    },
                    {
                      "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, cb)` {Function} A function that will be called if the client supports SNI TLS extension. Two arguments will be passed when called: `servername` and `cb`. `SNICallback` should invoke `cb(null, ctx)`, where `ctx` is a `SecureContext` instance. (`tls.createSecureContext(...)` can be used to get a proper `SecureContext`.) If `SNICallback` wasn't provided the default callback with high-level API will be used (see below).",
                      "name": "SNICallback(servername,",
                      "desc": "cb)` {Function} A function that will be called if the client supports SNI TLS extension. Two arguments will be passed when called: `servername` and `cb`. `SNICallback` should invoke `cb(null, ctx)`, where `ctx` is a `SecureContext` instance. (`tls.createSecureContext(...)` can be used to get a proper `SecureContext`.) 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 pseudo-random data. See [Session Resumption][] for more information.",
                      "name": "ticketKeys",
                      "type": "Buffer",
                      "desc": "48-bytes of cryptographically strong pseudo-random data. See [Session Resumption][] for more information."
                    },
                    {
                      "textRaw": "`pskCallback` {Function}",
                      "name": "pskCallback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "socket: {tls.TLSSocket} the server [`tls.TLSSocket`][] instance for this connection.",
                          "name": "socket",
                          "type": "tls.TLSSocket",
                          "desc": "the server [`tls.TLSSocket`][] instance for this connection."
                        },
                        {
                          "textRaw": "identity: {string} identity parameter sent from the client.",
                          "name": "identity",
                          "type": "string",
                          "desc": "identity parameter sent from the client."
                        },
                        {
                          "textRaw": "Returns: {Buffer|TypedArray|DataView} pre-shared key that must either be a buffer or `null` to stop the negotiation process. Returned PSK must be compatible with the selected cipher's digest. When negotiating TLS-PSK (pre-shared keys), this function is called with the identity provided by the client. If the return value is `null` the negotiation process will stop and an \"unknown_psk_identity\" alert message will be sent to the other party. If the server wishes to hide the fact that the PSK identity was not known, the callback must provide some random data as `psk` to make the connection fail with \"decrypt_error\" before negotiation is finished. PSK ciphers are disabled by default, and using TLS-PSK thus requires explicitly specifying a cipher suite with the `ciphers` option. More information can be found in the [RFC 4279][].",
                          "name": "return",
                          "type": "Buffer|TypedArray|DataView",
                          "desc": "pre-shared key that must either be a buffer or `null` to stop the negotiation process. Returned PSK must be compatible with the selected cipher's digest. When negotiating TLS-PSK (pre-shared keys), this function is called with the identity provided by the client. If the return value is `null` the negotiation process will stop and an \"unknown_psk_identity\" alert message will be sent to the other party. If the server wishes to hide the fact that the PSK identity was not known, the callback must provide some random data as `psk` to make the connection fail with \"decrypt_error\" before negotiation is finished. PSK ciphers are disabled by default, and using TLS-PSK thus requires explicitly specifying a cipher suite with the `ciphers` option. More information can be found in the [RFC 4279][]."
                        }
                      ]
                    },
                    {
                      "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_IDENTIY_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_IDENTIY_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."
                    }
                  ]
                },
                {
                  "textRaw": "`secureConnectionListener` {Function}",
                  "name": "secureConnectionListener",
                  "type": "Function"
                }
              ]
            }
          ],
          "desc": "<p>Creates a new <a href=\"tls.html#tls_class_tls_server\"><code>tls.Server</code></a>. The <code>secureConnectionListener</code>, if provided, is\nautomatically set as a listener for the <a href=\"tls.html#tls_event_secureconnection\"><code>'secureConnection'</code></a> event.</p>\n<p>The <code>ticketKeys</code> options is automatically shared between <code>cluster</code> module\nworkers.</p>\n<p>The following illustrates a simple echo server:</p>\n<pre><code class=\"language-js\">const tls = require('tls');\nconst fs = require('fs');\n\nconst options = {\n  key: fs.readFileSync('server-key.pem'),\n  cert: fs.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: [ fs.readFileSync('client-cert.pem') ]\n};\n\nconst server = tls.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>The server can be tested by connecting to it using the example client from\n<a href=\"tls.html#tls_tls_connect_options_callback\"><code>tls.connect()</code></a>.</p>"
        },
        {
          "textRaw": "`tls.getCiphers()`",
          "type": "method",
          "name": "getCiphers",
          "meta": {
            "added": [
              "v0.10.2"
            ],
            "changes": []
          },
          "signatures": [
            {
              "return": {
                "textRaw": "Returns: {string[]}",
                "name": "return",
                "type": "string[]"
              },
              "params": []
            }
          ],
          "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=\"tls.html#tls_tls_createsecurecontext_options\"><code>tls.createSecureContext()</code></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": "`rootCertificates` {string[]}",
          "type": "string[]",
          "name": "rootCertificates",
          "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 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>"
        },
        {
          "textRaw": "`tls.DEFAULT_ECDH_CURVE`",
          "name": "DEFAULT_ECDH_CURVE",
          "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=\"tls.html#tls_tls_createsecurecontext_options\"><code>tls.createSecureContext()</code></a> for further\ninformation.</p>"
        },
        {
          "textRaw": "`DEFAULT_MAX_VERSION` {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.",
          "type": "string",
          "name": "DEFAULT_MAX_VERSION",
          "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": "`DEFAULT_MIN_VERSION` {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'`. **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.",
          "type": "string",
          "name": "DEFAULT_MIN_VERSION",
          "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'`."
        }
      ],
      "type": "module",
      "displayName": "TLS (SSL)"
    },
    {
      "textRaw": "Trace events",
      "name": "trace_events",
      "introduced_in": "v7.7.0",
      "stability": 1,
      "stabilityText": "Experimental",
      "desc": "<p>The <code>trace_events</code> module provides a mechanism to centralize tracing information\ngenerated 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>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.dns.native</code>: Enables capture of trace data for DNS queries.</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>\n<p><code>node.perf</code>: Enables capture of <a href=\"perf_hooks.html\">Performance API</a> measurements.</p>\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>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</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>trace_events</code> module:</p>\n<pre><code class=\"language-js\">const trace_events = require('trace_events');\nconst tracing = trace_events.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>Starting with Node.js 10.0.0, 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#worker_threads_class_worker\"><code>Worker</code></a> threads.</p>",
      "modules": [
        {
          "textRaw": "The `trace_events` module",
          "name": "the_`trace_events`_module",
          "meta": {
            "added": [
              "v10.0.0"
            ],
            "changes": []
          },
          "modules": [
            {
              "textRaw": "`Tracing` object",
              "name": "`tracing`_object",
              "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": "`categories` {string}",
                  "type": "string",
                  "name": "categories",
                  "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": "`enabled` {boolean} `true` only if the `Tracing` object has been enabled.",
                  "type": "boolean",
                  "name": "enabled",
                  "meta": {
                    "added": [
                      "v10.0.0"
                    ],
                    "changes": []
                  },
                  "desc": "`true` only if the `Tracing` object has been enabled."
                }
              ],
              "methods": [
                {
                  "textRaw": "`tracing.disable()`",
                  "type": "method",
                  "name": "disable",
                  "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-js\">const trace_events = require('trace_events');\nconst t1 = trace_events.createTracing({ categories: ['node', 'v8'] });\nconst t2 = trace_events.createTracing({ categories: ['node.perf', 'node'] });\nt1.enable();\nt2.enable();\n\n// Prints 'node,node.perf,v8'\nconsole.log(trace_events.getEnabledCategories());\n\nt2.disable(); // Will only disable emission of the 'node.perf' category\n\n// Prints 'node,v8'\nconsole.log(trace_events.getEnabledCategories());\n</code></pre>"
                },
                {
                  "textRaw": "`tracing.enable()`",
                  "type": "method",
                  "name": "enable",
                  "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>"
                }
              ],
              "type": "module",
              "displayName": "`Tracing` object"
            }
          ],
          "methods": [
            {
              "textRaw": "`trace_events.createTracing(options)`",
              "type": "method",
              "name": "createTracing",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Tracing}.",
                    "name": "return",
                    "type": "Tracing",
                    "desc": "."
                  },
                  "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."
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Creates and returns a <code>Tracing</code> object for the given set of <code>categories</code>.</p>\n<pre><code class=\"language-js\">const trace_events = require('trace_events');\nconst categories = ['node.perf', 'node.async_hooks'];\nconst tracing = trace_events.createTracing({ categories });\ntracing.enable();\n// do stuff\ntracing.disable();\n</code></pre>"
            },
            {
              "textRaw": "`trace_events.getEnabledCategories()`",
              "type": "method",
              "name": "getEnabledCategories",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {string}",
                    "name": "return",
                    "type": "string"
                  },
                  "params": []
                }
              ],
              "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-js\">const trace_events = require('trace_events');\nconst t1 = trace_events.createTracing({ categories: ['node.async_hooks'] });\nconst t2 = trace_events.createTracing({ categories: ['node.perf'] });\nconst t3 = trace_events.createTracing({ categories: ['v8'] });\n\nt1.enable();\nt2.enable();\n\nconsole.log(trace_events.getEnabledCategories());\n</code></pre>"
            }
          ],
          "type": "module",
          "displayName": "The `trace_events` module"
        }
      ],
      "type": "module",
      "displayName": "Trace events"
    },
    {
      "textRaw": "TTY",
      "name": "tty",
      "introduced_in": "v0.10.0",
      "stability": 2,
      "stabilityText": "Stable",
      "desc": "<p>The <code>tty</code> module provides the <code>tty.ReadStream</code> and <code>tty.WriteStream</code> classes.\nIn most cases, it will not be necessary or possible to use this module directly.\nHowever, it can be accessed using:</p>\n<pre><code class=\"language-js\">const tty = require('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#process_process_stdin\"><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#process_process_stdout\"><code>process.stdout</code></a> and <a href=\"process.html#process_process_stderr\"><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`",
          "type": "class",
          "name": "tty.ReadStream",
          "meta": {
            "added": [
              "v0.5.8"
            ],
            "changes": []
          },
          "desc": "<ul>\n<li>Extends: <a href=\"net.html#net_class_net_socket\" class=\"type\">&lt;net.Socket&gt;</a></li>\n</ul>\n<p>Represents the readable side of a TTY. In normal circumstances\n<a href=\"process.html#process_process_stdin\"><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",
              "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. Defaults to <code>false</code>.</p>"
            },
            {
              "textRaw": "`readStream.isTTY`",
              "name": "isTTY",
              "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)`",
              "type": "method",
              "name": "setRawMode",
              "meta": {
                "added": [
                  "v0.7.7"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {this} The read stream instance.",
                    "name": "return",
                    "type": "this",
                    "desc": "The read stream instance."
                  },
                  "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."
                    }
                  ]
                }
              ],
              "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 characters.\n<code>CTRL</code>+<code>C</code> will no longer cause a <code>SIGINT</code> when in this mode.</p>"
            }
          ]
        },
        {
          "textRaw": "Class: `tty.WriteStream`",
          "type": "class",
          "name": "tty.WriteStream",
          "meta": {
            "added": [
              "v0.5.8"
            ],
            "changes": []
          },
          "desc": "<ul>\n<li>Extends: <a href=\"net.html#net_class_net_socket\" class=\"type\">&lt;net.Socket&gt;</a></li>\n</ul>\n<p>Represents the writable side of a TTY. In normal circumstances,\n<a href=\"process.html#process_process_stdout\"><code>process.stdout</code></a> and <a href=\"process.html#process_process_stderr\"><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>",
          "events": [
            {
              "textRaw": "Event: `'resize'`",
              "type": "event",
              "name": "resize",
              "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])`",
              "type": "method",
              "name": "clearLine",
              "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": [
                {
                  "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`."
                  },
                  "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."
                    }
                  ]
                }
              ],
              "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])`",
              "type": "method",
              "name": "clearScreenDown",
              "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": [
                {
                  "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`."
                  },
                  "params": [
                    {
                      "textRaw": "`callback` {Function} Invoked once the operation completes.",
                      "name": "callback",
                      "type": "Function",
                      "desc": "Invoked once the operation completes."
                    }
                  ]
                }
              ],
              "desc": "<p><code>writeStream.clearScreenDown()</code> clears this <code>WriteStream</code> from the current\ncursor down.</p>"
            },
            {
              "textRaw": "`writeStream.cursorTo(x[, y][, callback])`",
              "type": "method",
              "name": "cursorTo",
              "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": [
                {
                  "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`."
                  },
                  "params": [
                    {
                      "textRaw": "`x` {number}",
                      "name": "x",
                      "type": "number"
                    },
                    {
                      "textRaw": "`y` {number}",
                      "name": "y",
                      "type": "number"
                    },
                    {
                      "textRaw": "`callback` {Function} Invoked once the operation completes.",
                      "name": "callback",
                      "type": "Function",
                      "desc": "Invoked once the operation completes."
                    }
                  ]
                }
              ],
              "desc": "<p><code>writeStream.cursorTo()</code> moves this <code>WriteStream</code>'s cursor to the specified\nposition.</p>"
            },
            {
              "textRaw": "`writeStream.getColorDepth([env])`",
              "type": "method",
              "name": "getColorDepth",
              "meta": {
                "added": [
                  "v9.9.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {number}",
                    "name": "return",
                    "type": "number"
                  },
                  "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."
                    }
                  ]
                }
              ],
              "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\ncolors 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()`",
              "type": "method",
              "name": "getWindowSize",
              "meta": {
                "added": [
                  "v0.7.7"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {number[]}",
                    "name": "return",
                    "type": "number[]"
                  },
                  "params": []
                }
              ],
              "desc": "<p><code>writeStream.getWindowSize()</code> returns the size of the <a href=\"tty.html\">TTY</a>\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 <a href=\"tty.html\">TTY</a>.</p>"
            },
            {
              "textRaw": "`writeStream.hasColors([count][, env])`",
              "type": "method",
              "name": "hasColors",
              "meta": {
                "added": [
                  "v11.13.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  },
                  "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)."
                    },
                    {
                      "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."
                    }
                  ]
                }
              ],
              "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=\"tty.html#tty_writestream_getcolordepth_env\"><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])`",
              "type": "method",
              "name": "moveCursor",
              "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": [
                {
                  "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`."
                  },
                  "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."
                    }
                  ]
                }
              ],
              "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",
              "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",
              "meta": {
                "added": [
                  "v0.5.8"
                ],
                "changes": []
              },
              "desc": "<p>A <code>boolean</code> that is always <code>true</code>.</p>"
            },
            {
              "textRaw": "`writeStream.rows`",
              "name": "rows",
              "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)`",
          "type": "method",
          "name": "isatty",
          "meta": {
            "added": [
              "v0.5.8"
            ],
            "changes": []
          },
          "signatures": [
            {
              "return": {
                "textRaw": "Returns: {boolean}",
                "name": "return",
                "type": "boolean"
              },
              "params": [
                {
                  "textRaw": "`fd` {number} A numeric file descriptor",
                  "name": "fd",
                  "type": "number",
                  "desc": "A numeric file descriptor"
                }
              ]
            }
          ],
          "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>"
        }
      ],
      "type": "module",
      "displayName": "TTY"
    },
    {
      "textRaw": "UDP/datagram sockets",
      "name": "dgram",
      "introduced_in": "v0.10.0",
      "stability": 2,
      "stabilityText": "Stable",
      "desc": "<p>The <code>dgram</code> module provides an implementation of UDP datagram sockets.</p>\n<pre><code class=\"language-js\">const dgram = require('dgram');\nconst server = dgram.createSocket('udp4');\n\nserver.on('error', (err) => {\n  console.log(`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`",
          "type": "class",
          "name": "dgram.Socket",
          "meta": {
            "added": [
              "v0.1.99"
            ],
            "changes": []
          },
          "desc": "<ul>\n<li>Extends: <a href=\"events.html#events_class_eventemitter\" class=\"type\">&lt;EventEmitter&gt;</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=\"dgram.html#dgram_dgram_createsocket_options_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'`",
              "type": "event",
              "name": "close",
              "meta": {
                "added": [
                  "v0.1.99"
                ],
                "changes": []
              },
              "params": [],
              "desc": "<p>The <code>'close'</code> event is emitted after a socket is closed with <a href=\"dgram.html#dgram_socket_close_callback\"><code>close()</code></a>.\nOnce triggered, no new <code>'message'</code> events will be emitted on this socket.</p>"
            },
            {
              "textRaw": "Event: `'connect'`",
              "type": "event",
              "name": "connect",
              "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=\"dgram.html#dgram_socket_connect_port_address_callback\"><code>connect()</code></a> call.</p>"
            },
            {
              "textRaw": "Event: `'error'`",
              "type": "event",
              "name": "error",
              "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'`",
              "type": "event",
              "name": "listening",
              "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'`",
              "type": "event",
              "name": "message",
              "meta": {
                "added": [
                  "v0.1.99"
                ],
                "changes": []
              },
              "params": [],
              "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<ul>\n<li><code>msg</code> <a href=\"buffer.html#buffer_class_buffer\" class=\"type\">&lt;Buffer&gt;</a> The message.</li>\n<li>\n<p><code>rinfo</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object\" class=\"type\">&lt;Object&gt;</a> Remote address information.</p>\n<ul>\n<li><code>address</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string&gt;</a> The sender address.</li>\n<li><code>family</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string&gt;</a> The address family (<code>'IPv4'</code> or <code>'IPv6'</code>).</li>\n<li><code>port</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;number&gt;</a> The sender port.</li>\n<li><code>size</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;number&gt;</a> The message size.</li>\n</ul>\n</li>\n</ul>"
            }
          ],
          "methods": [
            {
              "textRaw": "`socket.addMembership(multicastAddress[, multicastInterface])`",
              "type": "method",
              "name": "addMembership",
              "meta": {
                "added": [
                  "v0.6.9"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`multicastAddress` {string}",
                      "name": "multicastAddress",
                      "type": "string"
                    },
                    {
                      "textRaw": "`multicastInterface` {string}",
                      "name": "multicastInterface",
                      "type": "string"
                    }
                  ]
                }
              ],
              "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 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-js\">const cluster = require('cluster');\nconst dgram = require('dgram');\nif (cluster.isMaster) {\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])`",
              "type": "method",
              "name": "addSourceSpecificMembership",
              "meta": {
                "added": [
                  "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"
                    }
                  ]
                }
              ],
              "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>"
            },
            {
              "textRaw": "`socket.address()`",
              "type": "method",
              "name": "address",
              "meta": {
                "added": [
                  "v0.1.99"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Object}",
                    "name": "return",
                    "type": "Object"
                  },
                  "params": []
                }
              ],
              "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>"
            },
            {
              "textRaw": "`socket.bind([port][, address][, callback])`",
              "type": "method",
              "name": "bind",
              "meta": {
                "added": [
                  "v0.1.99"
                ],
                "changes": [
                  {
                    "version": "v0.10",
                    "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"
                    },
                    {
                      "textRaw": "`address` {string}",
                      "name": "address",
                      "type": "string"
                    },
                    {
                      "textRaw": "`callback` {Function} with no parameters. Called when binding is complete.",
                      "name": "callback",
                      "type": "Function",
                      "desc": "with no parameters. Called when binding is complete."
                    }
                  ]
                }
              ],
              "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#errors_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-js\">const dgram = require('dgram');\nconst server = dgram.createSocket('udp4');\n\nserver.on('error', (err) => {\n  console.log(`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])`",
              "type": "method",
              "name": "bind",
              "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"
                    }
                  ]
                }
              ],
              "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.</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#errors_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])`",
              "type": "method",
              "name": "close",
              "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."
                    }
                  ]
                }
              ],
              "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=\"dgram.html#dgram_event_close\"><code>'close'</code></a> event.</p>"
            },
            {
              "textRaw": "`socket.connect(port[, address][, callback])`",
              "type": "method",
              "name": "connect",
              "meta": {
                "added": [
                  "v12.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`port` {integer}",
                      "name": "port",
                      "type": "integer"
                    },
                    {
                      "textRaw": "`address` {string}",
                      "name": "address",
                      "type": "string"
                    },
                    {
                      "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."
                    }
                  ]
                }
              ],
              "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#errors_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()`",
              "type": "method",
              "name": "disconnect",
              "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 already disconnected\nsocket will result in an <a href=\"errors.html#errors_err_socket_dgram_not_connected\"><code>ERR_SOCKET_DGRAM_NOT_CONNECTED</code></a> exception.</p>"
            },
            {
              "textRaw": "`socket.dropMembership(multicastAddress[, multicastInterface])`",
              "type": "method",
              "name": "dropMembership",
              "meta": {
                "added": [
                  "v0.6.9"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`multicastAddress` {string}",
                      "name": "multicastAddress",
                      "type": "string"
                    },
                    {
                      "textRaw": "`multicastInterface` {string}",
                      "name": "multicastInterface",
                      "type": "string"
                    }
                  ]
                }
              ],
              "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])`",
              "type": "method",
              "name": "dropSourceSpecificMembership",
              "meta": {
                "added": [
                  "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"
                    }
                  ]
                }
              ],
              "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()`",
              "type": "method",
              "name": "getRecvBufferSize",
              "meta": {
                "added": [
                  "v8.7.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "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."
                  },
                  "params": []
                }
              ]
            },
            {
              "textRaw": "`socket.getSendBufferSize()`",
              "type": "method",
              "name": "getSendBufferSize",
              "meta": {
                "added": [
                  "v8.7.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "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."
                  },
                  "params": []
                }
              ]
            },
            {
              "textRaw": "`socket.ref()`",
              "type": "method",
              "name": "ref",
              "meta": {
                "added": [
                  "v0.9.1"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {dgram.Socket}",
                    "name": "return",
                    "type": "dgram.Socket"
                  },
                  "params": []
                }
              ],
              "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()`",
              "type": "method",
              "name": "remoteAddress",
              "meta": {
                "added": [
                  "v12.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Object}",
                    "name": "return",
                    "type": "Object"
                  },
                  "params": []
                }
              ],
              "desc": "<p>Returns an object containing the <code>address</code>, <code>family</code>, and <code>port</code> of the remote\nendpoint. It throws an <a href=\"errors.html#errors_err_socket_dgram_not_connected\"><code>ERR_SOCKET_DGRAM_NOT_CONNECTED</code></a> exception if the\nsocket is not connected.</p>"
            },
            {
              "textRaw": "`socket.send(msg[, offset, length][, port][, address][, callback])`",
              "type": "method",
              "name": "send",
              "meta": {
                "added": [
                  "v0.1.99"
                ],
                "changes": [
                  {
                    "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."
                  },
                  {
                    "version": "v12.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/26871",
                    "description": "Added support for sending data on connected sockets."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`msg` {Buffer|Uint8Array|string|Array} Message to be sent.",
                      "name": "msg",
                      "type": "Buffer|Uint8Array|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."
                    },
                    {
                      "textRaw": "`length` {integer} Number of bytes in the message.",
                      "name": "length",
                      "type": "integer",
                      "desc": "Number of bytes in the message."
                    },
                    {
                      "textRaw": "`port` {integer} Destination port.",
                      "name": "port",
                      "type": "integer",
                      "desc": "Destination port."
                    },
                    {
                      "textRaw": "`address` {string} Destination host name or IP address.",
                      "name": "address",
                      "type": "string",
                      "desc": "Destination host name or IP address."
                    },
                    {
                      "textRaw": "`callback` {Function} Called when the message has been sent.",
                      "name": "callback",
                      "type": "Function",
                      "desc": "Called when the message has been sent."
                    }
                  ]
                }
              ],
              "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>\nor <code>Uint8Array</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#buffer_class_method_buffer_bytelength_string_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 falsy, <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> or <code>Uint8Array</code>.</p>\n<p>Example of sending a UDP packet to a port on <code>localhost</code>;</p>\n<pre><code class=\"language-js\">const dgram = require('dgram');\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-js\">const dgram = require('dgram');\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-js\">const dgram = require('dgram');\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",
                  "desc": "<p>The maximum size of an <code>IPv4/v6</code> datagram depends on the <code>MTU</code>\n(<em>Maximum Transmission Unit</em>) and on the <code>Payload Length</code> field size.</p>\n<ul>\n<li>\n<p>The <code>Payload Length</code> field is <code>16 bits</code> wide, which means that a normal\npayload exceed 64K octets <em>including</em> 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, <code>IPv4</code> mandates a minimum <code>MTU</code> of <code>68</code>\noctets, while the recommended <code>MTU</code> for IPv4 is <code>576</code> (typically recommended\nas the <code>MTU</code> for dial-up type applications), whether they arrive whole or in\nfragments.</p>\n<p>For <code>IPv6</code>, the minimum <code>MTU</code> is <code>1280</code> octets, however, the mandatory minimum\nfragment reassembly buffer size is <code>1500</code> octets. The value of <code>68</code> octets is\nvery small, since most current link layer technologies, like Ethernet, have a\nminimum <code>MTU</code> of <code>1500</code>.</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>",
                  "type": "module",
                  "displayName": "Note about UDP datagram size"
                }
              ]
            },
            {
              "textRaw": "`socket.setBroadcast(flag)`",
              "type": "method",
              "name": "setBroadcast",
              "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>"
            },
            {
              "textRaw": "`socket.setMulticastInterface(multicastInterface)`",
              "type": "method",
              "name": "setMulticastInterface",
              "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 Indices</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<h4>Example: IPv6 outgoing multicast interface</h4>\n<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>\n<h4>Example: IPv4 outgoing multicast interface</h4>\n<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>",
              "modules": [
                {
                  "textRaw": "Call results",
                  "name": "call_results",
                  "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#errors_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#errors_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#errors_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>",
                  "type": "module",
                  "displayName": "Call results"
                }
              ]
            },
            {
              "textRaw": "`socket.setMulticastLoopback(flag)`",
              "type": "method",
              "name": "setMulticastLoopback",
              "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>"
            },
            {
              "textRaw": "`socket.setMulticastTTL(ttl)`",
              "type": "method",
              "name": "setMulticastTTL",
              "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>"
            },
            {
              "textRaw": "`socket.setRecvBufferSize(size)`",
              "type": "method",
              "name": "setRecvBufferSize",
              "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>"
            },
            {
              "textRaw": "`socket.setSendBufferSize(size)`",
              "type": "method",
              "name": "setSendBufferSize",
              "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>"
            },
            {
              "textRaw": "`socket.setTTL(ttl)`",
              "type": "method",
              "name": "setTTL",
              "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 between 1 and 255. The default on most systems\nis 64.</p>"
            },
            {
              "textRaw": "`socket.unref()`",
              "type": "method",
              "name": "unref",
              "meta": {
                "added": [
                  "v0.9.1"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {dgram.Socket}",
                    "name": "return",
                    "type": "dgram.Socket"
                  },
                  "params": []
                }
              ],
              "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 addition effect.</p>\n<p>The <code>socket.unref()</code> method returns a reference to the socket so calls can be\nchained.</p>"
            }
          ]
        }
      ],
      "modules": [
        {
          "textRaw": "`dgram` module functions",
          "name": "`dgram`_module_functions",
          "methods": [
            {
              "textRaw": "`dgram.createSocket(options[, callback])`",
              "type": "method",
              "name": "createSocket",
              "meta": {
                "added": [
                  "v0.11.13"
                ],
                "changes": [
                  {
                    "version": "v8.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/14560",
                    "description": "The `lookup` 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": "v11.4.0",
                    "pr-url": "https://github.com/nodejs/node/pull/23798",
                    "description": "The `ipv6Only` option is supported."
                  }
                ]
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {dgram.Socket}",
                    "name": "return",
                    "type": "dgram.Socket"
                  },
                  "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. **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."
                        },
                        {
                          "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": "`callback` {Function} Attached as a listener for `'message'` events. Optional.",
                      "name": "callback",
                      "type": "Function",
                      "desc": "Attached as a listener for `'message'` events. Optional."
                    }
                  ]
                }
              ],
              "desc": "<p>Creates a <code>dgram.Socket</code> object. Once the socket is created, calling\n<a href=\"dgram.html#dgram_socket_bind_port_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=\"dgram.html#dgram_socket_bind_port_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=\"dgram.html#dgram_socket_address\"><code>socket.address().address</code></a> and\n<a href=\"dgram.html#dgram_socket_address\"><code>socket.address().port</code></a>.</p>"
            },
            {
              "textRaw": "`dgram.createSocket(type[, callback])`",
              "type": "method",
              "name": "createSocket",
              "meta": {
                "added": [
                  "v0.1.99"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {dgram.Socket}",
                    "name": "return",
                    "type": "dgram.Socket"
                  },
                  "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."
                    }
                  ]
                }
              ],
              "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=\"dgram.html#dgram_socket_bind_port_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=\"dgram.html#dgram_socket_bind_port_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=\"dgram.html#dgram_socket_address\"><code>socket.address().address</code></a> and <a href=\"dgram.html#dgram_socket_address\"><code>socket.address().port</code></a>.</p>"
            }
          ],
          "type": "module",
          "displayName": "`dgram` module functions"
        }
      ],
      "type": "module",
      "displayName": "dgram"
    },
    {
      "textRaw": "URL",
      "name": "url",
      "introduced_in": "v0.10.0",
      "stability": 2,
      "stabilityText": "Stable",
      "desc": "<p>The <code>url</code> module provides utilities for URL resolution and parsing. It can be\naccessed using:</p>\n<pre><code class=\"language-js\">const url = require('url');\n</code></pre>",
      "modules": [
        {
          "textRaw": "URL strings and URL objects",
          "name": "url_strings_and_url_objects",
          "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>url</code> module provides two APIs for working with URLs: a legacy API that is\nNode.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>'http://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-js\">const url = require('url');\nconst myURL =\n  url.parse('https://user:pass@sub.example.com:8080/p/a/t/h?query=string#hash');\n</code></pre>",
          "type": "module",
          "displayName": "URL strings and URL objects"
        },
        {
          "textRaw": "The WHATWG URL API",
          "name": "the_whatwg_url_api",
          "classes": [
            {
              "textRaw": "Class: `URL`",
              "type": "class",
              "name": "URL",
              "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=\"url.html#url_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>",
              "properties": [
                {
                  "textRaw": "`hash` {string}",
                  "type": "string",
                  "name": "hash",
                  "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=\"url.html#whatwg-percent-encoding\">percent-encoded</a>. The selection of which characters to\npercent-encode may vary somewhat from what the <a href=\"url.html#url_url_parse_urlstring_parsequerystring_slashesdenotehost\"><code>url.parse()</code></a> and\n<a href=\"url.html#url_url_format_urlobject\"><code>url.format()</code></a> methods would produce.</p>"
                },
                {
                  "textRaw": "`host` {string}",
                  "type": "string",
                  "name": "host",
                  "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": "`hostname` {string}",
                  "type": "string",
                  "name": "hostname",
                  "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\nmyURL.hostname = 'example.com:82';\nconsole.log(myURL.href);\n// Prints https://example.com:81/foo\n</code></pre>\n<p>Invalid host name values assigned to the <code>hostname</code> property are ignored.</p>"
                },
                {
                  "textRaw": "`href` {string}",
                  "type": "string",
                  "name": "href",
                  "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=\"url.html#url_url_tostring\"><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=\"url.html#url_constructor_new_url_input_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": "`origin` {string}",
                  "type": "string",
                  "name": "origin",
                  "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": "`password` {string}",
                  "type": "string",
                  "name": "password",
                  "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=\"url.html#whatwg-percent-encoding\">percent-encoded</a>. The selection of which characters to\npercent-encode may vary somewhat from what the <a href=\"url.html#url_url_parse_urlstring_parsequerystring_slashesdenotehost\"><code>url.parse()</code></a> and\n<a href=\"url.html#url_url_format_urlobject\"><code>url.format()</code></a> methods would produce.</p>"
                },
                {
                  "textRaw": "`pathname` {string}",
                  "type": "string",
                  "name": "pathname",
                  "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=\"url.html#whatwg-percent-encoding\">percent-encoded</a>. The selection of which characters\nto percent-encode may vary somewhat from what the <a href=\"url.html#url_url_parse_urlstring_parsequerystring_slashesdenotehost\"><code>url.parse()</code></a> and\n<a href=\"url.html#url_url_format_urlobject\"><code>url.format()</code></a> methods would produce.</p>"
                },
                {
                  "textRaw": "`port` {string}",
                  "type": "string",
                  "name": "port",
                  "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>\"gopher\"</td>\n<td>70</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": "`protocol` {string}",
                  "type": "string",
                  "name": "protocol",
                  "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",
                      "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>gopher</code>, <code>http</code>, <code>https</code>, <code>ws</code>, and <code>wss</code>.</p>",
                      "type": "module",
                      "displayName": "Special schemes"
                    }
                  ]
                },
                {
                  "textRaw": "`search` {string}",
                  "type": "string",
                  "name": "search",
                  "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=\"url.html#whatwg-percent-encoding\">percent-encoded</a>. The selection of which\ncharacters to percent-encode may vary somewhat from what the <a href=\"url.html#url_url_parse_urlstring_parsequerystring_slashesdenotehost\"><code>url.parse()</code></a>\nand <a href=\"url.html#url_url_format_urlobject\"><code>url.format()</code></a> methods would produce.</p>"
                },
                {
                  "textRaw": "`searchParams` {URLSearchParams}",
                  "type": "URLSearchParams",
                  "name": "searchParams",
                  "desc": "<p>Gets the <a href=\"url.html#url_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=\"url.html#url_url_search\"><code>url.search</code></a> setter. See\n<a href=\"url.html#url_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": "`username` {string}",
                  "type": "string",
                  "name": "username",
                  "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=\"url.html#whatwg-percent-encoding\">percent-encoded</a>. The selection of which\ncharacters to percent-encode may vary somewhat from what the <a href=\"url.html#url_url_parse_urlstring_parsequerystring_slashesdenotehost\"><code>url.parse()</code></a>\nand <a href=\"url.html#url_url_format_urlobject\"><code>url.format()</code></a> methods would produce.</p>"
                }
              ],
              "methods": [
                {
                  "textRaw": "`url.toString()`",
                  "type": "method",
                  "name": "toString",
                  "signatures": [
                    {
                      "return": {
                        "textRaw": "Returns: {string}",
                        "name": "return",
                        "type": "string"
                      },
                      "params": []
                    }
                  ],
                  "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=\"url.html#url_url_href\"><code>url.href</code></a> and <a href=\"url.html#url_url_tojson\"><code>url.toJSON()</code></a>.</p>\n<p>Because of the need for standard compliance, this method does not allow users\nto customize the serialization process of the URL. For more flexibility,\n<a href=\"url.html#url_url_format_url_options\"><code>require('url').format()</code></a> method might be of interest.</p>"
                },
                {
                  "textRaw": "`url.toJSON()`",
                  "type": "method",
                  "name": "toJSON",
                  "signatures": [
                    {
                      "return": {
                        "textRaw": "Returns: {string}",
                        "name": "return",
                        "type": "string"
                      },
                      "params": []
                    }
                  ],
                  "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=\"url.html#url_url_href\"><code>url.href</code></a> and\n<a href=\"url.html#url_url_tostring\"><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>"
                }
              ],
              "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.",
                      "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."
                    },
                    {
                      "textRaw": "`base` {string|URL} The base URL to resolve against if the `input` is not absolute.",
                      "name": "base",
                      "type": "string|URL",
                      "desc": "The base URL to resolve against if the `input` is not absolute."
                    }
                  ],
                  "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-js\">console.log(URL === require('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>This feature is only available if the <code>node</code> executable was compiled with\n<a href=\"intl.html#intl_options_for_building_node_js\">ICU</a> enabled. If not, the domain names are passed through unchanged.</p>\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>"
                }
              ]
            },
            {
              "textRaw": "Class: `URLSearchParams`",
              "type": "class",
              "name": "URLSearchParams",
              "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>",
              "methods": [
                {
                  "textRaw": "`urlSearchParams.append(name, value)`",
                  "type": "method",
                  "name": "append",
                  "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)`",
                  "type": "method",
                  "name": "delete",
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`name` {string}",
                          "name": "name",
                          "type": "string"
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Remove all name-value pairs whose name is <code>name</code>.</p>"
                },
                {
                  "textRaw": "`urlSearchParams.entries()`",
                  "type": "method",
                  "name": "entries",
                  "signatures": [
                    {
                      "return": {
                        "textRaw": "Returns: {Iterator}",
                        "name": "return",
                        "type": "Iterator"
                      },
                      "params": []
                    }
                  ],
                  "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=\"url.html#url_urlsearchparams_symbol_iterator\"><code>urlSearchParams[@@iterator]()</code></a>.</p>"
                },
                {
                  "textRaw": "`urlSearchParams.forEach(fn[, thisArg])`",
                  "type": "method",
                  "name": "forEach",
                  "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"
                        }
                      ]
                    }
                  ],
                  "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)`",
                  "type": "method",
                  "name": "get",
                  "signatures": [
                    {
                      "return": {
                        "textRaw": "Returns: {string} or `null` if there is no name-value pair with the given `name`.",
                        "name": "return",
                        "type": "string",
                        "desc": "or `null` if there is no name-value pair with the given `name`."
                      },
                      "params": [
                        {
                          "textRaw": "`name` {string}",
                          "name": "name",
                          "type": "string"
                        }
                      ]
                    }
                  ],
                  "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)`",
                  "type": "method",
                  "name": "getAll",
                  "signatures": [
                    {
                      "return": {
                        "textRaw": "Returns: {string[]}",
                        "name": "return",
                        "type": "string[]"
                      },
                      "params": [
                        {
                          "textRaw": "`name` {string}",
                          "name": "name",
                          "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)`",
                  "type": "method",
                  "name": "has",
                  "signatures": [
                    {
                      "return": {
                        "textRaw": "Returns: {boolean}",
                        "name": "return",
                        "type": "boolean"
                      },
                      "params": [
                        {
                          "textRaw": "`name` {string}",
                          "name": "name",
                          "type": "string"
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Returns <code>true</code> if there is at least one name-value pair whose name is <code>name</code>.</p>"
                },
                {
                  "textRaw": "`urlSearchParams.keys()`",
                  "type": "method",
                  "name": "keys",
                  "signatures": [
                    {
                      "return": {
                        "textRaw": "Returns: {Iterator}",
                        "name": "return",
                        "type": "Iterator"
                      },
                      "params": []
                    }
                  ],
                  "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)`",
                  "type": "method",
                  "name": "set",
                  "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()`",
                  "type": "method",
                  "name": "sort",
                  "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()`",
                  "type": "method",
                  "name": "toString",
                  "signatures": [
                    {
                      "return": {
                        "textRaw": "Returns: {string}",
                        "name": "return",
                        "type": "string"
                      },
                      "params": []
                    }
                  ],
                  "desc": "<p>Returns the search parameters serialized as a string, with characters\npercent-encoded where necessary.</p>"
                },
                {
                  "textRaw": "`urlSearchParams.values()`",
                  "type": "method",
                  "name": "values",
                  "signatures": [
                    {
                      "return": {
                        "textRaw": "Returns: {Iterator}",
                        "name": "return",
                        "type": "Iterator"
                      },
                      "params": []
                    }
                  ],
                  "desc": "<p>Returns an ES6 <code>Iterator</code> over the values of each name-value pair.</p>"
                },
                {
                  "textRaw": "`urlSearchParams[Symbol.iterator]()`",
                  "type": "method",
                  "name": "[Symbol.iterator]",
                  "signatures": [
                    {
                      "return": {
                        "textRaw": "Returns: {Iterator}",
                        "name": "return",
                        "type": "Iterator"
                      },
                      "params": []
                    }
                  ],
                  "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=\"url.html#url_urlsearchparams_entries\"><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>"
                }
              ],
              "signatures": [
                {
                  "params": [],
                  "desc": "<p>Instantiate a new empty <code>URLSearchParams</code> object.</p>"
                },
                {
                  "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>"
                },
                {
                  "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>"
                },
                {
                  "params": [
                    {
                      "textRaw": "`iterable` {Iterable} An iterable object whose elements are key-value pairs",
                      "name": "iterable",
                      "type": "Iterable",
                      "desc": "An iterable object whose elements are key-value pairs"
                    }
                  ],
                  "desc": "<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/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map\"><code>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": "`url.domainToASCII(domain)`",
              "type": "method",
              "name": "domainToASCII",
              "meta": {
                "added": [
                  "v7.4.0",
                  "v6.13.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {string}",
                    "name": "return",
                    "type": "string"
                  },
                  "params": [
                    {
                      "textRaw": "`domain` {string}",
                      "name": "domain",
                      "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=\"url.html#url_url_domaintounicode_domain\"><code>url.domainToUnicode()</code></a>.</p>\n<pre><code class=\"language-js\">const url = require('url');\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)`",
              "type": "method",
              "name": "domainToUnicode",
              "meta": {
                "added": [
                  "v7.4.0",
                  "v6.13.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {string}",
                    "name": "return",
                    "type": "string"
                  },
                  "params": [
                    {
                      "textRaw": "`domain` {string}",
                      "name": "domain",
                      "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=\"url.html#url_url_domaintoascii_domain\"><code>url.domainToASCII()</code></a>.</p>\n<pre><code class=\"language-js\">const url = require('url');\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)`",
              "type": "method",
              "name": "fileURLToPath",
              "meta": {
                "added": [
                  "v10.12.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "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."
                  },
                  "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."
                    }
                  ]
                }
              ],
              "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<pre><code class=\"language-js\">new 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.format(URL[, options])`",
              "type": "method",
              "name": "format",
              "meta": {
                "added": [
                  "v7.6.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {string}",
                    "name": "return",
                    "type": "string"
                  },
                  "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."
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Returns a customizable serialization of a URL <code>String</code> representation of a\n<a href=\"url.html#url_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-js\">const 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)`",
              "type": "method",
              "name": "pathToFileURL",
              "meta": {
                "added": [
                  "v10.12.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {URL} The file URL object.",
                    "name": "return",
                    "type": "URL",
                    "desc": "The file URL object."
                  },
                  "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."
                    }
                  ]
                }
              ],
              "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-js\">new 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>"
            }
          ],
          "type": "module",
          "displayName": "The WHATWG URL API"
        },
        {
          "textRaw": "Legacy URL API",
          "name": "legacy_url_api",
          "stability": 0,
          "stabilityText": "Deprecated: Use the WHATWG URL API instead.",
          "modules": [
            {
              "textRaw": "Legacy `urlObject`",
              "name": "legacy_`urlobject`",
              "meta": {
                "changes": [
                  {
                    "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('url').Url</code>) is created and returned by the\n<code>url.parse()</code> function.</p>",
              "properties": [
                {
                  "textRaw": "`urlObject.auth`",
                  "name": "auth",
                  "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",
                  "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",
                  "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",
                  "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",
                  "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",
                  "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",
                  "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",
                  "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",
                  "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",
                  "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",
                  "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",
                  "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>"
                }
              ],
              "type": "module",
              "displayName": "Legacy `urlObject`"
            }
          ],
          "methods": [
            {
              "textRaw": "`url.format(urlObject)`",
              "type": "method",
              "name": "format",
              "meta": {
                "added": [
                  "v0.1.25"
                ],
                "changes": [
                  {
                    "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 false-y `slashes` option with no protocol is now also respected at all times."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`urlObject` {Object|string} A URL object (as returned by `url.parse()` or constructed otherwise). If a string, it is converted to an object by passing it to `url.parse()`.",
                      "name": "urlObject",
                      "type": "Object|string",
                      "desc": "A URL object (as returned by `url.parse()` or constructed otherwise). If a string, it is converted to an object by passing it to `url.parse()`."
                    }
                  ]
                }
              ],
              "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\">url.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#errors_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#errors_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>\n<p>If either of the following conditions is true, then the literal string <code>//</code>\nwill be appended to <code>result</code>:</p>\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>\n<p>If the <code>urlObject.host</code> property is <code>undefined</code> then:</p>\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#errors_class_error\"><code>Error</code></a> is thrown.</li>\n<li>\n<p>If the <code>urlObject.port</code> property value is truthy, and <code>urlObject.hostname</code>\nis not <code>undefined</code>:</p>\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>\n<p>If the <code>urlObject.pathname</code> property is a string that is not an empty string:</p>\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#errors_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>\n<p>Otherwise, if <code>urlObject.search</code> is a string:</p>\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#errors_class_error\"><code>Error</code></a> is thrown.</li>\n<li>\n<p>If the <code>urlObject.hash</code> property is a string:</p>\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#errors_class_error\"><code>Error</code></a> is thrown.</li>\n<li><code>result</code> is returned.</li>\n</ul>"
            },
            {
              "textRaw": "`url.parse(urlString[, parseQueryString[, slashesDenoteHost]])`",
              "type": "method",
              "name": "parse",
              "meta": {
                "added": [
                  "v0.1.25"
                ],
                "changes": [
                  {
                    "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."
                  }
                ]
              },
              "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."
                    },
                    {
                      "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'}`."
                    }
                  ]
                }
              ],
              "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>"
            },
            {
              "textRaw": "`url.resolve(from, to)`",
              "type": "method",
              "name": "resolve",
              "meta": {
                "added": [
                  "v0.1.25"
                ],
                "changes": [
                  {
                    "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."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`from` {string} The Base URL being resolved against.",
                      "name": "from",
                      "type": "string",
                      "desc": "The Base URL being resolved against."
                    },
                    {
                      "textRaw": "`to` {string} The HREF URL being resolved.",
                      "name": "to",
                      "type": "string",
                      "desc": "The HREF URL being resolved."
                    }
                  ]
                }
              ],
              "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 HREF.</p>\n<pre><code class=\"language-js\">const url = require('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><a id=\"whatwg-percent-encoding\"></a></p>"
            }
          ],
          "type": "module",
          "displayName": "Legacy URL API"
        },
        {
          "textRaw": "Percent-encoding in URLs",
          "name": "percent-encoding_in_urls",
          "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",
              "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>",
              "type": "module",
              "displayName": "Legacy API"
            },
            {
              "textRaw": "WHATWG API",
              "name": "whatwg_api",
              "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, U+0022, U+003C, U+003E, and 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, U+0022, U+0023, U+003C, U+003E, U+003F, U+0060,\nU+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, U+005B, U+005C, U+005D,\nU+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>",
              "type": "module",
              "displayName": "WHATWG API"
            }
          ],
          "type": "module",
          "displayName": "Percent-encoding in URLs"
        }
      ],
      "type": "module",
      "displayName": "URL"
    },
    {
      "textRaw": "Util",
      "name": "util",
      "introduced_in": "v0.10.0",
      "stability": 2,
      "stabilityText": "Stable",
      "desc": "<p>The <code>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-js\">const util = require('util');\n</code></pre>",
      "methods": [
        {
          "textRaw": "`util.callbackify(original)`",
          "type": "method",
          "name": "callbackify",
          "meta": {
            "added": [
              "v8.2.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "return": {
                "textRaw": "Returns: {Function} a callback style function",
                "name": "return",
                "type": "Function",
                "desc": "a callback style function"
              },
              "params": [
                {
                  "textRaw": "`original` {Function} An `async` function",
                  "name": "original",
                  "type": "Function",
                  "desc": "An `async` 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-js\">const util = require('util');\n\nasync function fn() {\n  return 'hello world';\n}\nconst callbackFunction = util.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#process_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-js\">function 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; err.hasOwnProperty('reason') &#x26;&#x26; err.reason === null;  // true\n});\n</code></pre>"
        },
        {
          "textRaw": "`util.debuglog(section)`",
          "type": "method",
          "name": "debuglog",
          "meta": {
            "added": [
              "v0.11.3"
            ],
            "changes": []
          },
          "signatures": [
            {
              "return": {
                "textRaw": "Returns: {Function} The logging function",
                "name": "return",
                "type": "Function",
                "desc": "The logging function"
              },
              "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."
                }
              ]
            }
          ],
          "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#console_console_error_data_args\"><code>console.error()</code></a>. If not, then the returned function is a no-op.</p>\n<pre><code class=\"language-js\">const util = require('util');\nconst debuglog = util.debuglog('foo');\n\ndebuglog('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-js\">const util = require('util');\nconst debuglog = util.debuglog('foo-bar');\n\ndebuglog('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>"
        },
        {
          "textRaw": "`util.deprecate(fn, msg[, code])`",
          "type": "method",
          "name": "deprecate",
          "meta": {
            "added": [
              "v0.8.0"
            ],
            "changes": [
              {
                "version": "v10.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/16393",
                "description": "Deprecation warnings are only emitted once for each code."
              }
            ]
          },
          "signatures": [
            {
              "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."
              },
              "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."
                }
              ]
            }
          ],
          "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-js\">const util = require('util');\n\nexports.obsoleteFunction = util.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#process_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-js\">const util = require('util');\n\nconst fn1 = util.deprecate(someFunction, someMessage, 'DEP0001');\nconst fn2 = util.deprecate(someOtherFunction, someOtherMessage, 'DEP0001');\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.format(format[, ...args])`",
          "type": "method",
          "name": "format",
          "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": "v11.4.0",
                "pr-url": "https://github.com/nodejs/node/pull/23708",
                "description": "The `%d`, `%f` and `%i` specifiers now support Symbols properly."
              },
              {
                "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/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."
                }
              ]
            }
          ],
          "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 no user defined <code>toString</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/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string&gt;</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])`",
          "type": "method",
          "name": "formatWithOptions",
          "meta": {
            "added": [
              "v10.0.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`inspectOptions` {Object}",
                  "name": "inspectOptions",
                  "type": "Object"
                },
                {
                  "textRaw": "`format` {string}",
                  "name": "format",
                  "type": "string"
                }
              ]
            }
          ],
          "desc": "<p>This function is identical to <a href=\"util.html#util_util_format_format_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=\"util.html#util_util_inspect_object_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.getSystemErrorName(err)`",
          "type": "method",
          "name": "getSystemErrorName",
          "meta": {
            "added": [
              "v9.7.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "return": {
                "textRaw": "Returns: {string}",
                "name": "return",
                "type": "string"
              },
              "params": [
                {
                  "textRaw": "`err` {number}",
                  "name": "err",
                  "type": "number"
                }
              ]
            }
          ],
          "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#errors_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.inherits(constructor, superConstructor)`",
          "type": "method",
          "name": "inherits",
          "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."
              }
            ]
          },
          "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('util');\nconst EventEmitter = require('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-js\">const EventEmitter = require('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])`",
          "type": "method",
          "name": "inspect",
          "meta": {
            "added": [
              "v0.3.0"
            ],
            "changes": [
              {
                "version": "v12.17.0",
                "pr-url": "https://github.com/nodejs/node/pull/32392",
                "description": "The `maxStringLength` option is supported now."
              },
              {
                "version": "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": "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": "v11.11.0",
                "pr-url": "https://github.com/nodejs/node/pull/26269",
                "description": "The `compact` option accepts numbers for a new output mode."
              },
              {
                "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.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": "v10.12.0",
                "pr-url": "https://github.com/nodejs/node/pull/22788",
                "description": "The `sorted` option is supported now."
              },
              {
                "version": "v11.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/22756",
                "description": "The inspection output is now limited to about 128 MB. Data above that size will not be fully inspected."
              },
              {
                "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": [
            {
              "return": {
                "textRaw": "Returns: {string} The representation of `object`.",
                "name": "return",
                "type": "string",
                "desc": "The representation of `object`."
              },
              "params": [
                {
                  "textRaw": "`object` {any} Any JavaScript primitive or `Object`.",
                  "name": "object",
                  "type": "any",
                  "desc": "Any JavaScript primitive or `Object`."
                },
                {
                  "textRaw": "`options` {Object}",
                  "name": "options",
                  "type": "Object",
                  "options": [
                    {
                      "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)."
                    },
                    {
                      "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`."
                    },
                    {
                      "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][]."
                    },
                    {
                      "textRaw": "`customInspect` {boolean} If `false`, `[util.inspect.custom](depth, opts)` functions are not invoked. **Default:** `true`.",
                      "name": "customInspect",
                      "type": "boolean",
                      "default": "`true`",
                      "desc": "If `false`, `[util.inspect.custom](depth, opts)` functions are not invoked."
                    },
                    {
                      "textRaw": "`showProxy` {boolean} If `true`, `Proxy` inspection includes the [`target` and `handler`][] objects. **Default:** `false`.",
                      "name": "showProxy",
                      "type": "boolean",
                      "default": "`false`",
                      "desc": "If `true`, `Proxy` inspection includes the [`target` and `handler`][] objects."
                    },
                    {
                      "textRaw": "`maxArrayLength` {integer} Specifies the maximum number of `Array`, [`TypedArray`][], [`WeakMap`][] and [`WeakSet`][] elements to include when formatting. Set to `null` or `Infinity` to show all elements. Set to `0` or negative to show no elements. **Default:** `100`.",
                      "name": "maxArrayLength",
                      "type": "integer",
                      "default": "`100`",
                      "desc": "Specifies the maximum number of `Array`, [`TypedArray`][], [`WeakMap`][] and [`WeakSet`][] elements to include when formatting. Set to `null` or `Infinity` to show all elements. Set to `0` or negative to show no elements."
                    },
                    {
                      "textRaw": "`maxStringLength` {integer} Specifies the maximum number of characters to include when formatting. Set to `null` or `Infinity` to show all elements. Set to `0` or negative to show no characters. **Default:** `Infinity`.",
                      "name": "maxStringLength",
                      "type": "integer",
                      "default": "`Infinity`",
                      "desc": "Specifies the maximum number of characters to include when formatting. Set to `null` or `Infinity` to show all elements. Set to `0` or negative to show no characters."
                    },
                    {
                      "textRaw": "`breakLength` {integer} The length at which input values are split across multiple lines. Set to `Infinity` to format the input as a single line (in combination with `compact` set to `true` or any number >= `1`). **Default:** `80`.",
                      "name": "breakLength",
                      "type": "integer",
                      "default": "`80`",
                      "desc": "The length at which input values are split across multiple lines. Set to `Infinity` to format the input as a single line (in combination with `compact` set to `true` or any number >= `1`)."
                    },
                    {
                      "textRaw": "`compact` {boolean|integer} Setting this to `false` causes each object key to be displayed on a new line. It will also add new lines to text that is longer than `breakLength`. If set to a number, the most `n` inner elements are united on a single line as long as all properties fit into `breakLength`. Short array elements are also grouped together. No text will be reduced below 16 characters, no matter the `breakLength` size. For more information, see the example below. **Default:** `3`.",
                      "name": "compact",
                      "type": "boolean|integer",
                      "default": "`3`",
                      "desc": "Setting this to `false` causes each object key to be displayed on a new line. It will also add new lines to text that is longer than `breakLength`. If set to a number, the most `n` inner elements are united on a single line as long as all properties fit into `breakLength`. Short array elements are also grouped together. No text will be reduced below 16 characters, no matter the `breakLength` size. For more information, see the example below."
                    },
                    {
                      "textRaw": "`sorted` {boolean|Function} If set to `true` or a function, all properties of an object, and `Set` and `Map` entries are sorted in the resulting string. If set to `true` the [default sort][] is used. If set to a function, it is used as a [compare function][].",
                      "name": "sorted",
                      "type": "boolean|Function",
                      "desc": "If set to `true` or a function, all properties of an object, and `Set` and `Map` entries are sorted in the resulting string. If set to `true` the [default sort][] is used. If set to a function, it is used as a [compare function][]."
                    },
                    {
                      "textRaw": "`getters` {boolean|string} If set to `true`, getters are inspected. If set to `'get'`, only getters without a corresponding setter are inspected. If set to `'set'`, only getters with a corresponding setter are inspected. This might cause side effects depending on the getter function. **Default:** `false`.",
                      "name": "getters",
                      "type": "boolean|string",
                      "default": "`false`",
                      "desc": "If set to `true`, getters are inspected. If set to `'get'`, only getters without a corresponding setter are inspected. If set to `'set'`, only getters with a corresponding setter are inspected. This might cause side effects depending on the getter function."
                    }
                  ]
                }
              ]
            }
          ],
          "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>@@toStringTag</code> to make\nan 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 are marked as <code>'[Circular]'</code>:</p>\n<pre><code class=\"language-js\">const { inspect } = require('util');\n\nconst obj = {};\nobj.a = [obj];\nobj.b = {};\nobj.b.inner = obj.b;\nobj.b.obj = obj;\n\nconsole.log(inspect(obj));\n// {\n//   a: [ [Circular] ],\n//   b: { inner: [Circular], obj: [Circular] }\n// }\n</code></pre>\n<p>The following example inspects all properties of the <code>util</code> object:</p>\n<pre><code class=\"language-js\">const util = require('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-js\">const util = require('util');\n\nconst o = {\n  a: [1, 2, [[\n    'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do ' +\n      'eiusmod tempor incididunt ut labore et dolore magna aliqua.',\n    'test',\n    'foo']], 4],\n  b: new Map([['za', 1], ['zb', 'test']])\n};\nconsole.log(util.inspect(o, { compact: true, depth: 5, breakLength: 80 }));\n\n// { a:\n//   [ 1,\n//     2,\n//     [ [ 'Lorem ipsum dolor sit amet, consectetur [...]', // A long line\n//           'test',\n//           'foo' ] ],\n//     4 ],\n//   b: Map { 'za' => 1, 'zb' => 'test' } }\n\n// Setting `compact` to false changes the output to be more reader friendly.\nconsole.log(util.inspect(o, { compact: false, depth: 5, breakLength: 80 }));\n\n// {\n//   a: [\n//     1,\n//     2,\n//     [\n//       [\n//         'Lorem ipsum dolor sit amet, consectetur ' +\n//           'adipiscing elit, sed do eiusmod tempor ' +\n//           'incididunt ut labore et dolore magna ' +\n//           'aliqua.,\n//         'test',\n//         'foo'\n//       ]\n//     ],\n//     4\n//   ],\n//   b: Map {\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// Reducing the `breakLength` will split the \"Lorem ipsum\" text in smaller\n// chunks.\n</code></pre>\n<p>The <code>showHidden</code> option allows <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap\"><code>WeakMap</code></a> and <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet\"><code>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/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet\"><code>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-js\">const { inspect } = require('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-js\">const { inspect } = require('util');\nconst assert = require('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 { 1, 2, 3 } }\nconsole.log(inspect(o1, { sorted: (a, b) => b.localeCompare(a) }));\n// { c: Set { 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><code>util.inspect()</code> is a synchronous method intended for debugging. Its maximum\noutput length is approximately 128 MB. Inputs that result in longer output will\nbe truncated.</p>"
        },
        {
          "textRaw": "`util.inspect(object[, showHidden[, depth[, colors]]])`",
          "type": "method",
          "name": "inspect",
          "meta": {
            "added": [
              "v0.3.0"
            ],
            "changes": [
              {
                "version": "v12.17.0",
                "pr-url": "https://github.com/nodejs/node/pull/32392",
                "description": "The `maxStringLength` option is supported now."
              },
              {
                "version": "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": "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": "v11.11.0",
                "pr-url": "https://github.com/nodejs/node/pull/26269",
                "description": "The `compact` option accepts numbers for a new output mode."
              },
              {
                "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.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": "v10.12.0",
                "pr-url": "https://github.com/nodejs/node/pull/22788",
                "description": "The `sorted` option is supported now."
              },
              {
                "version": "v11.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/22756",
                "description": "The inspection output is now limited to about 128 MB. Data above that size will not be fully inspected."
              },
              {
                "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": [
            {
              "return": {
                "textRaw": "Returns: {string} The representation of `object`.",
                "name": "return",
                "type": "string",
                "desc": "The representation of `object`."
              },
              "params": [
                {
                  "textRaw": "`object` {any} Any JavaScript primitive or `Object`.",
                  "name": "object",
                  "type": "any",
                  "desc": "Any JavaScript primitive or `Object`."
                },
                {
                  "textRaw": "`options` {Object}",
                  "name": "options",
                  "type": "Object",
                  "options": [
                    {
                      "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)."
                    },
                    {
                      "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`."
                    },
                    {
                      "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][]."
                    },
                    {
                      "textRaw": "`customInspect` {boolean} If `false`, `[util.inspect.custom](depth, opts)` functions are not invoked. **Default:** `true`.",
                      "name": "customInspect",
                      "type": "boolean",
                      "default": "`true`",
                      "desc": "If `false`, `[util.inspect.custom](depth, opts)` functions are not invoked."
                    },
                    {
                      "textRaw": "`showProxy` {boolean} If `true`, `Proxy` inspection includes the [`target` and `handler`][] objects. **Default:** `false`.",
                      "name": "showProxy",
                      "type": "boolean",
                      "default": "`false`",
                      "desc": "If `true`, `Proxy` inspection includes the [`target` and `handler`][] objects."
                    },
                    {
                      "textRaw": "`maxArrayLength` {integer} Specifies the maximum number of `Array`, [`TypedArray`][], [`WeakMap`][] and [`WeakSet`][] elements to include when formatting. Set to `null` or `Infinity` to show all elements. Set to `0` or negative to show no elements. **Default:** `100`.",
                      "name": "maxArrayLength",
                      "type": "integer",
                      "default": "`100`",
                      "desc": "Specifies the maximum number of `Array`, [`TypedArray`][], [`WeakMap`][] and [`WeakSet`][] elements to include when formatting. Set to `null` or `Infinity` to show all elements. Set to `0` or negative to show no elements."
                    },
                    {
                      "textRaw": "`maxStringLength` {integer} Specifies the maximum number of characters to include when formatting. Set to `null` or `Infinity` to show all elements. Set to `0` or negative to show no characters. **Default:** `Infinity`.",
                      "name": "maxStringLength",
                      "type": "integer",
                      "default": "`Infinity`",
                      "desc": "Specifies the maximum number of characters to include when formatting. Set to `null` or `Infinity` to show all elements. Set to `0` or negative to show no characters."
                    },
                    {
                      "textRaw": "`breakLength` {integer} The length at which input values are split across multiple lines. Set to `Infinity` to format the input as a single line (in combination with `compact` set to `true` or any number >= `1`). **Default:** `80`.",
                      "name": "breakLength",
                      "type": "integer",
                      "default": "`80`",
                      "desc": "The length at which input values are split across multiple lines. Set to `Infinity` to format the input as a single line (in combination with `compact` set to `true` or any number >= `1`)."
                    },
                    {
                      "textRaw": "`compact` {boolean|integer} Setting this to `false` causes each object key to be displayed on a new line. It will also add new lines to text that is longer than `breakLength`. If set to a number, the most `n` inner elements are united on a single line as long as all properties fit into `breakLength`. Short array elements are also grouped together. No text will be reduced below 16 characters, no matter the `breakLength` size. For more information, see the example below. **Default:** `3`.",
                      "name": "compact",
                      "type": "boolean|integer",
                      "default": "`3`",
                      "desc": "Setting this to `false` causes each object key to be displayed on a new line. It will also add new lines to text that is longer than `breakLength`. If set to a number, the most `n` inner elements are united on a single line as long as all properties fit into `breakLength`. Short array elements are also grouped together. No text will be reduced below 16 characters, no matter the `breakLength` size. For more information, see the example below."
                    },
                    {
                      "textRaw": "`sorted` {boolean|Function} If set to `true` or a function, all properties of an object, and `Set` and `Map` entries are sorted in the resulting string. If set to `true` the [default sort][] is used. If set to a function, it is used as a [compare function][].",
                      "name": "sorted",
                      "type": "boolean|Function",
                      "desc": "If set to `true` or a function, all properties of an object, and `Set` and `Map` entries are sorted in the resulting string. If set to `true` the [default sort][] is used. If set to a function, it is used as a [compare function][]."
                    },
                    {
                      "textRaw": "`getters` {boolean|string} If set to `true`, getters are inspected. If set to `'get'`, only getters without a corresponding setter are inspected. If set to `'set'`, only getters with a corresponding setter are inspected. This might cause side effects depending on the getter function. **Default:** `false`.",
                      "name": "getters",
                      "type": "boolean|string",
                      "default": "`false`",
                      "desc": "If set to `true`, getters are inspected. If set to `'get'`, only getters without a corresponding setter are inspected. If set to `'set'`, only getters with a corresponding setter are inspected. This might cause side effects depending on the getter function."
                    }
                  ]
                }
              ]
            }
          ],
          "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>@@toStringTag</code> to make\nan 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 are marked as <code>'[Circular]'</code>:</p>\n<pre><code class=\"language-js\">const { inspect } = require('util');\n\nconst obj = {};\nobj.a = [obj];\nobj.b = {};\nobj.b.inner = obj.b;\nobj.b.obj = obj;\n\nconsole.log(inspect(obj));\n// {\n//   a: [ [Circular] ],\n//   b: { inner: [Circular], obj: [Circular] }\n// }\n</code></pre>\n<p>The following example inspects all properties of the <code>util</code> object:</p>\n<pre><code class=\"language-js\">const util = require('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-js\">const util = require('util');\n\nconst o = {\n  a: [1, 2, [[\n    'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do ' +\n      'eiusmod tempor incididunt ut labore et dolore magna aliqua.',\n    'test',\n    'foo']], 4],\n  b: new Map([['za', 1], ['zb', 'test']])\n};\nconsole.log(util.inspect(o, { compact: true, depth: 5, breakLength: 80 }));\n\n// { a:\n//   [ 1,\n//     2,\n//     [ [ 'Lorem ipsum dolor sit amet, consectetur [...]', // A long line\n//           'test',\n//           'foo' ] ],\n//     4 ],\n//   b: Map { 'za' => 1, 'zb' => 'test' } }\n\n// Setting `compact` to false changes the output to be more reader friendly.\nconsole.log(util.inspect(o, { compact: false, depth: 5, breakLength: 80 }));\n\n// {\n//   a: [\n//     1,\n//     2,\n//     [\n//       [\n//         'Lorem ipsum dolor sit amet, consectetur ' +\n//           'adipiscing elit, sed do eiusmod tempor ' +\n//           'incididunt ut labore et dolore magna ' +\n//           'aliqua.,\n//         'test',\n//         'foo'\n//       ]\n//     ],\n//     4\n//   ],\n//   b: Map {\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// Reducing the `breakLength` will split the \"Lorem ipsum\" text in smaller\n// chunks.\n</code></pre>\n<p>The <code>showHidden</code> option allows <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap\"><code>WeakMap</code></a> and <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet\"><code>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/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet\"><code>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-js\">const { inspect } = require('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-js\">const { inspect } = require('util');\nconst assert = require('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 { 1, 2, 3 } }\nconsole.log(inspect(o1, { sorted: (a, b) => b.localeCompare(a) }));\n// { c: Set { 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><code>util.inspect()</code> is a synchronous method intended for debugging. Its maximum\noutput length is approximately 128 MB. 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>: <code>red</code></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#tty_writestream_hascolors_count_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": "Modifiers",
                  "name": "modifiers",
                  "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;\">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\">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\">framed</span> - Draw a frame around the text</li>\n</ul>",
                  "type": "misc",
                  "displayName": "Modifiers"
                },
                {
                  "textRaw": "Foreground colors",
                  "name": "foreground_colors",
                  "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>",
                  "type": "misc",
                  "displayName": "Foreground colors"
                },
                {
                  "textRaw": "Background colors",
                  "name": "background_colors",
                  "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>",
                  "type": "misc",
                  "displayName": "Background colors"
                }
              ]
            },
            {
              "textRaw": "Custom inspection functions on objects",
              "name": "Custom inspection functions on objects",
              "type": "misc",
              "desc": "<p>Objects may also define their own\n<a href=\"util.html#util_util_inspect_custom\"><code>[util.inspect.custom](depth, opts)</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-js\">const util = require('util');\n\nclass Box {\n  constructor(value) {\n    this.value = value;\n  }\n\n  [util.inspect.custom](depth, options) {\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 = util.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\nutil.inspect(box);\n// Returns: \"Box&#x3C; true >\"\n</code></pre>\n<p>Custom <code>[util.inspect.custom](depth, opts)</code> functions typically return a string\nbut may return a value of any type that will be formatted accordingly by\n<code>util.inspect()</code>.</p>\n<pre><code class=\"language-js\">const util = require('util');\n\nconst obj = { foo: 'this will not show up in the inspect() output' };\nobj[util.inspect.custom] = (depth) => {\n  return { bar: 'baz' };\n};\n\nutil.inspect(obj);\n// Returns: \"{ bar: 'baz' }\"\n</code></pre>"
            }
          ],
          "properties": [
            {
              "textRaw": "`custom` {symbol} that can be used to declare custom inspect functions.",
              "type": "symbol",
              "name": "custom",
              "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<pre><code class=\"language-js\">const inspect = 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  [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=\"util.html#util_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",
              "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=\"util.html#util_util_inspect_object_options\"><code>util.inspect()</code></a> options. Setting\noption properties directly is also supported.</p>\n<pre><code class=\"language-js\">const util = require('util');\nconst arr = Array(101).fill(0);\n\nconsole.log(arr); // Logs the truncated array\nutil.inspect.defaultOptions.maxArrayLength = null;\nconsole.log(arr); // logs the full array\n</code></pre>"
            }
          ]
        },
        {
          "textRaw": "`util.isDeepStrictEqual(val1, val2)`",
          "type": "method",
          "name": "isDeepStrictEqual",
          "meta": {
            "added": [
              "v9.0.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "return": {
                "textRaw": "Returns: {boolean}",
                "name": "return",
                "type": "boolean"
              },
              "params": [
                {
                  "textRaw": "`val1` {any}",
                  "name": "val1",
                  "type": "any"
                },
                {
                  "textRaw": "`val2` {any}",
                  "name": "val2",
                  "type": "any"
                }
              ]
            }
          ],
          "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>See <a href=\"assert.html#assert_assert_deepstrictequal_actual_expected_message\"><code>assert.deepStrictEqual()</code></a> for more information about deep strict\nequality.</p>"
        },
        {
          "textRaw": "`util.promisify(original)`",
          "type": "method",
          "name": "promisify",
          "meta": {
            "added": [
              "v8.0.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "return": {
                "textRaw": "Returns: {Function}",
                "name": "return",
                "type": "Function"
              },
              "params": [
                {
                  "textRaw": "`original` {Function}",
                  "name": "original",
                  "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-js\">const util = require('util');\nconst fs = require('fs');\n\nconst stat = util.promisify(fs.stat);\nstat('.').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-js\">const util = require('util');\nconst fs = require('fs');\n\nconst stat = util.promisify(fs.stat);\n\nasync function callStat() {\n  const stats = await stat('.');\n  console.log(`This directory is owned by ${stats.uid}`);\n}\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=\"util.html#util_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-js\">const util = require('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 = util.promisify(foo.bar);\n// TypeError: Cannot read property 'a' of undefined\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",
              "desc": "<p>Using the <code>util.promisify.custom</code> symbol one can override the return value of\n<a href=\"util.html#util_util_promisify_original\"><code>util.promisify()</code></a>:</p>\n<pre><code class=\"language-js\">const util = require('util');\n\nfunction doSomething(foo, callback) {\n  // ...\n}\n\ndoSomething[util.promisify.custom] = (foo) => {\n  return getPromiseSomehow();\n};\n\nconst promisified = util.promisify(doSomething);\nconsole.log(promisified === doSomething[util.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>",
              "type": "module",
              "displayName": "Custom promisified functions"
            }
          ],
          "properties": [
            {
              "textRaw": "`custom` {symbol} that can be used to declare custom promisified variants of functions, see [Custom promisified functions][].",
              "type": "symbol",
              "name": "custom",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "changes": [
                  {
                    "version": "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][]."
            }
          ]
        }
      ],
      "classes": [
        {
          "textRaw": "Class: `util.TextDecoder`",
          "type": "class",
          "name": "util.TextDecoder",
          "meta": {
            "added": [
              "v8.3.0"
            ],
            "changes": []
          },
          "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('shift_jis');\nlet string = '';\nlet buffer;\nwhile (buffer = getNextChunkSomehow()) {\n  string += decoder.decode(buffer, { stream: true });\n}\nstring += decoder.decode(); // end-of-stream\n</code></pre>",
          "modules": [
            {
              "textRaw": "WHATWG supported encodings",
              "name": "whatwg_supported_encodings",
              "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.\nWhile a very basic set of encodings is supported even on Node.js builds without\nICU enabled, support for some encodings is provided only when Node.js is built\nwith ICU and using the full ICU data (see <a href=\"intl.html\">Internationalization</a>).</p>",
              "modules": [
                {
                  "textRaw": "Encodings Supported Without ICU",
                  "name": "encodings_supported_without_icu",
                  "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>",
                  "type": "module",
                  "displayName": "Encodings Supported Without ICU"
                },
                {
                  "textRaw": "Encodings Supported by Default (With ICU)",
                  "name": "encodings_supported_by_default_(with_icu)",
                  "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>",
                  "type": "module",
                  "displayName": "Encodings Supported by Default (With ICU)"
                },
                {
                  "textRaw": "Encodings requiring full ICU data",
                  "name": "encodings_requiring_full_icu_data",
                  "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>\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>",
                  "type": "module",
                  "displayName": "Encodings requiring full ICU data"
                }
              ],
              "type": "module",
              "displayName": "WHATWG supported encodings"
            }
          ],
          "methods": [
            {
              "textRaw": "`textDecoder.decode([input[, options]])`",
              "type": "method",
              "name": "decode",
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {string}",
                    "name": "return",
                    "type": "string"
                  },
                  "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."
                    },
                    {
                      "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."
                        }
                      ]
                    }
                  ]
                }
              ],
              "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": "`encoding` {string}",
              "type": "string",
              "name": "encoding",
              "desc": "<p>The encoding supported by the <code>TextDecoder</code> instance.</p>"
            },
            {
              "textRaw": "`fatal` {boolean}",
              "type": "boolean",
              "name": "fatal",
              "desc": "<p>The value will be <code>true</code> if decoding errors result in a <code>TypeError</code> being\nthrown.</p>"
            },
            {
              "textRaw": "`ignoreBOM` {boolean}",
              "type": "boolean",
              "name": "ignoreBOM",
              "desc": "<p>The value will be <code>true</code> if the decoding result will include the byte order\nmark.</p>"
            }
          ],
          "signatures": [
            {
              "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."
                },
                {
                  "textRaw": "`options` {Object}",
                  "name": "options",
                  "type": "Object",
                  "options": [
                    {
                      "textRaw": "`fatal` {boolean} `true` if decoding failures are fatal. This option is only supported when ICU is enabled (see [Internationalization][]). **Default:** `false`.",
                      "name": "fatal",
                      "type": "boolean",
                      "default": "`false`",
                      "desc": "`true` if decoding failures are fatal. This option is only supported when ICU is enabled (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'`."
                    }
                  ]
                }
              ],
              "desc": "<p>Creates an 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>"
            }
          ]
        },
        {
          "textRaw": "Class: `util.TextEncoder`",
          "type": "class",
          "name": "util.TextEncoder",
          "meta": {
            "added": [
              "v8.3.0"
            ],
            "changes": [
              {
                "version": "v11.0.0",
                "pr-url": "v11.0.0",
                "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])`",
              "type": "method",
              "name": "encode",
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Uint8Array}",
                    "name": "return",
                    "type": "Uint8Array"
                  },
                  "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."
                    }
                  ]
                }
              ],
              "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)`",
              "type": "method",
              "name": "encodeInto",
              "signatures": [
                {
                  "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."
                      }
                    ]
                  },
                  "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."
                    }
                  ]
                }
              ],
              "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": "`encoding` {string}",
              "type": "string",
              "name": "encoding",
              "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",
          "meta": {
            "added": [
              "v10.0.0"
            ],
            "changes": []
          },
          "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>",
          "methods": [
            {
              "textRaw": "`util.types.isAnyArrayBuffer(value)`",
              "type": "method",
              "name": "isAnyArrayBuffer",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  },
                  "params": [
                    {
                      "textRaw": "`value` {any}",
                      "name": "value",
                      "type": "any"
                    }
                  ]
                }
              ],
              "desc": "<p>Returns <code>true</code> if the value is a built-in <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer\"><code>ArrayBuffer</code></a> or\n<a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer\"><code>SharedArrayBuffer</code></a> instance.</p>\n<p>See also <a href=\"util.html#util_util_types_isarraybuffer_value\"><code>util.types.isArrayBuffer()</code></a> and\n<a href=\"util.html#util_util_types_issharedarraybuffer_value\"><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)`",
              "type": "method",
              "name": "isArrayBufferView",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  },
                  "params": [
                    {
                      "textRaw": "`value` {any}",
                      "name": "value",
                      "type": "any"
                    }
                  ]
                }
              ],
              "desc": "<p>Returns <code>true</code> if the value is an instance of one of the <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer\"><code>ArrayBuffer</code></a>\nviews, such as typed array objects or <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView\"><code>DataView</code></a>. Equivalent to\n<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)`",
              "type": "method",
              "name": "isArgumentsObject",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  },
                  "params": [
                    {
                      "textRaw": "`value` {any}",
                      "name": "value",
                      "type": "any"
                    }
                  ]
                }
              ],
              "desc": "<p>Returns <code>true</code> if the value is an <code>arguments</code> object.</p>\n<!-- eslint-disable prefer-rest-params -->\n<pre><code class=\"language-js\">function foo() {\n  util.types.isArgumentsObject(arguments);  // Returns true\n}\n</code></pre>"
            },
            {
              "textRaw": "`util.types.isArrayBuffer(value)`",
              "type": "method",
              "name": "isArrayBuffer",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  },
                  "params": [
                    {
                      "textRaw": "`value` {any}",
                      "name": "value",
                      "type": "any"
                    }
                  ]
                }
              ],
              "desc": "<p>Returns <code>true</code> if the value is a built-in <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer\"><code>ArrayBuffer</code></a> instance.\nThis does <em>not</em> include <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer\"><code>SharedArrayBuffer</code></a> instances. Usually, it is\ndesirable to test for both; See <a href=\"util.html#util_util_types_isanyarraybuffer_value\"><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)`",
              "type": "method",
              "name": "isAsyncFunction",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  },
                  "params": [
                    {
                      "textRaw": "`value` {any}",
                      "name": "value",
                      "type": "any"
                    }
                  ]
                }
              ],
              "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)`",
              "type": "method",
              "name": "isBigInt64Array",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  },
                  "params": [
                    {
                      "textRaw": "`value` {any}",
                      "name": "value",
                      "type": "any"
                    }
                  ]
                }
              ],
              "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.isBigUint64Array(value)`",
              "type": "method",
              "name": "isBigUint64Array",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  },
                  "params": [
                    {
                      "textRaw": "`value` {any}",
                      "name": "value",
                      "type": "any"
                    }
                  ]
                }
              ],
              "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)`",
              "type": "method",
              "name": "isBooleanObject",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  },
                  "params": [
                    {
                      "textRaw": "`value` {any}",
                      "name": "value",
                      "type": "any"
                    }
                  ]
                }
              ],
              "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)`",
              "type": "method",
              "name": "isBoxedPrimitive",
              "meta": {
                "added": [
                  "v10.11.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  },
                  "params": [
                    {
                      "textRaw": "`value` {any}",
                      "name": "value",
                      "type": "any"
                    }
                  ]
                }
              ],
              "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.isDataView(value)`",
              "type": "method",
              "name": "isDataView",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  },
                  "params": [
                    {
                      "textRaw": "`value` {any}",
                      "name": "value",
                      "type": "any"
                    }
                  ]
                }
              ],
              "desc": "<p>Returns <code>true</code> if the value is a built-in <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView\"><code>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)`",
              "type": "method",
              "name": "isDate",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  },
                  "params": [
                    {
                      "textRaw": "`value` {any}",
                      "name": "value",
                      "type": "any"
                    }
                  ]
                }
              ],
              "desc": "<p>Returns <code>true</code> if the value is a built-in <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date\"><code>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)`",
              "type": "method",
              "name": "isExternal",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  },
                  "params": [
                    {
                      "textRaw": "`value` {any}",
                      "name": "value",
                      "type": "any"
                    }
                  ]
                }
              ],
              "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-js\">const native = require('napi_addon.node');\nconst data = native.myNapi();\nutil.types.isExternal(data); // returns true\nutil.types.isExternal(0); // returns false\nutil.types.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#n_api_napi_create_external\"><code>napi_create_external()</code></a>.</p>"
            },
            {
              "textRaw": "`util.types.isFloat32Array(value)`",
              "type": "method",
              "name": "isFloat32Array",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  },
                  "params": [
                    {
                      "textRaw": "`value` {any}",
                      "name": "value",
                      "type": "any"
                    }
                  ]
                }
              ],
              "desc": "<p>Returns <code>true</code> if the value is a built-in <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array\"><code>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)`",
              "type": "method",
              "name": "isFloat64Array",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  },
                  "params": [
                    {
                      "textRaw": "`value` {any}",
                      "name": "value",
                      "type": "any"
                    }
                  ]
                }
              ],
              "desc": "<p>Returns <code>true</code> if the value is a built-in <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array\"><code>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)`",
              "type": "method",
              "name": "isGeneratorFunction",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  },
                  "params": [
                    {
                      "textRaw": "`value` {any}",
                      "name": "value",
                      "type": "any"
                    }
                  ]
                }
              ],
              "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)`",
              "type": "method",
              "name": "isGeneratorObject",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  },
                  "params": [
                    {
                      "textRaw": "`value` {any}",
                      "name": "value",
                      "type": "any"
                    }
                  ]
                }
              ],
              "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)`",
              "type": "method",
              "name": "isInt8Array",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  },
                  "params": [
                    {
                      "textRaw": "`value` {any}",
                      "name": "value",
                      "type": "any"
                    }
                  ]
                }
              ],
              "desc": "<p>Returns <code>true</code> if the value is a built-in <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array\"><code>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)`",
              "type": "method",
              "name": "isInt16Array",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  },
                  "params": [
                    {
                      "textRaw": "`value` {any}",
                      "name": "value",
                      "type": "any"
                    }
                  ]
                }
              ],
              "desc": "<p>Returns <code>true</code> if the value is a built-in <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array\"><code>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)`",
              "type": "method",
              "name": "isInt32Array",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  },
                  "params": [
                    {
                      "textRaw": "`value` {any}",
                      "name": "value",
                      "type": "any"
                    }
                  ]
                }
              ],
              "desc": "<p>Returns <code>true</code> if the value is a built-in <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array\"><code>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.isMap(value)`",
              "type": "method",
              "name": "isMap",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  },
                  "params": [
                    {
                      "textRaw": "`value` {any}",
                      "name": "value",
                      "type": "any"
                    }
                  ]
                }
              ],
              "desc": "<p>Returns <code>true</code> if the value is a built-in <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map\"><code>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)`",
              "type": "method",
              "name": "isMapIterator",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  },
                  "params": [
                    {
                      "textRaw": "`value` {any}",
                      "name": "value",
                      "type": "any"
                    }
                  ]
                }
              ],
              "desc": "<p>Returns <code>true</code> if the value is an iterator returned for a built-in\n<a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map\"><code>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)`",
              "type": "method",
              "name": "isModuleNamespaceObject",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  },
                  "params": [
                    {
                      "textRaw": "`value` {any}",
                      "name": "value",
                      "type": "any"
                    }
                  ]
                }
              ],
              "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<!-- eslint-skip -->\n<pre><code class=\"language-js\">import * as ns from './a.js';\n\nutil.types.isModuleNamespaceObject(ns);  // Returns true\n</code></pre>"
            },
            {
              "textRaw": "`util.types.isNativeError(value)`",
              "type": "method",
              "name": "isNativeError",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  },
                  "params": [
                    {
                      "textRaw": "`value` {any}",
                      "name": "value",
                      "type": "any"
                    }
                  ]
                }
              ],
              "desc": "<p>Returns <code>true</code> if the value is an instance of a built-in <a href=\"errors.html#errors_class_error\"><code>Error</code></a> type.</p>\n<pre><code class=\"language-js\">util.types.isNativeError(new Error());  // Returns true\nutil.types.isNativeError(new TypeError());  // Returns true\nutil.types.isNativeError(new RangeError());  // Returns true\n</code></pre>"
            },
            {
              "textRaw": "`util.types.isNumberObject(value)`",
              "type": "method",
              "name": "isNumberObject",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  },
                  "params": [
                    {
                      "textRaw": "`value` {any}",
                      "name": "value",
                      "type": "any"
                    }
                  ]
                }
              ],
              "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)`",
              "type": "method",
              "name": "isPromise",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  },
                  "params": [
                    {
                      "textRaw": "`value` {any}",
                      "name": "value",
                      "type": "any"
                    }
                  ]
                }
              ],
              "desc": "<p>Returns <code>true</code> if the value is a built-in <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise\"><code>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)`",
              "type": "method",
              "name": "isProxy",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  },
                  "params": [
                    {
                      "textRaw": "`value` {any}",
                      "name": "value",
                      "type": "any"
                    }
                  ]
                }
              ],
              "desc": "<p>Returns <code>true</code> if the value is a <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy\"><code>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)`",
              "type": "method",
              "name": "isRegExp",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  },
                  "params": [
                    {
                      "textRaw": "`value` {any}",
                      "name": "value",
                      "type": "any"
                    }
                  ]
                }
              ],
              "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)`",
              "type": "method",
              "name": "isSet",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  },
                  "params": [
                    {
                      "textRaw": "`value` {any}",
                      "name": "value",
                      "type": "any"
                    }
                  ]
                }
              ],
              "desc": "<p>Returns <code>true</code> if the value is a built-in <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set\"><code>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)`",
              "type": "method",
              "name": "isSetIterator",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  },
                  "params": [
                    {
                      "textRaw": "`value` {any}",
                      "name": "value",
                      "type": "any"
                    }
                  ]
                }
              ],
              "desc": "<p>Returns <code>true</code> if the value is an iterator returned for a built-in\n<a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set\"><code>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)`",
              "type": "method",
              "name": "isSharedArrayBuffer",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  },
                  "params": [
                    {
                      "textRaw": "`value` {any}",
                      "name": "value",
                      "type": "any"
                    }
                  ]
                }
              ],
              "desc": "<p>Returns <code>true</code> if the value is a built-in <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer\"><code>SharedArrayBuffer</code></a> instance.\nThis does <em>not</em> include <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer\"><code>ArrayBuffer</code></a> instances. Usually, it is\ndesirable to test for both; See <a href=\"util.html#util_util_types_isanyarraybuffer_value\"><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)`",
              "type": "method",
              "name": "isStringObject",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  },
                  "params": [
                    {
                      "textRaw": "`value` {any}",
                      "name": "value",
                      "type": "any"
                    }
                  ]
                }
              ],
              "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)`",
              "type": "method",
              "name": "isSymbolObject",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  },
                  "params": [
                    {
                      "textRaw": "`value` {any}",
                      "name": "value",
                      "type": "any"
                    }
                  ]
                }
              ],
              "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)`",
              "type": "method",
              "name": "isTypedArray",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  },
                  "params": [
                    {
                      "textRaw": "`value` {any}",
                      "name": "value",
                      "type": "any"
                    }
                  ]
                }
              ],
              "desc": "<p>Returns <code>true</code> if the value is a built-in <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray\"><code>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)`",
              "type": "method",
              "name": "isUint8Array",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  },
                  "params": [
                    {
                      "textRaw": "`value` {any}",
                      "name": "value",
                      "type": "any"
                    }
                  ]
                }
              ],
              "desc": "<p>Returns <code>true</code> if the value is a built-in <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array\"><code>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)`",
              "type": "method",
              "name": "isUint8ClampedArray",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  },
                  "params": [
                    {
                      "textRaw": "`value` {any}",
                      "name": "value",
                      "type": "any"
                    }
                  ]
                }
              ],
              "desc": "<p>Returns <code>true</code> if the value is a built-in <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray\"><code>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)`",
              "type": "method",
              "name": "isUint16Array",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  },
                  "params": [
                    {
                      "textRaw": "`value` {any}",
                      "name": "value",
                      "type": "any"
                    }
                  ]
                }
              ],
              "desc": "<p>Returns <code>true</code> if the value is a built-in <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array\"><code>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)`",
              "type": "method",
              "name": "isUint32Array",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  },
                  "params": [
                    {
                      "textRaw": "`value` {any}",
                      "name": "value",
                      "type": "any"
                    }
                  ]
                }
              ],
              "desc": "<p>Returns <code>true</code> if the value is a built-in <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array\"><code>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)`",
              "type": "method",
              "name": "isWeakMap",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  },
                  "params": [
                    {
                      "textRaw": "`value` {any}",
                      "name": "value",
                      "type": "any"
                    }
                  ]
                }
              ],
              "desc": "<p>Returns <code>true</code> if the value is a built-in <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap\"><code>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)`",
              "type": "method",
              "name": "isWeakSet",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  },
                  "params": [
                    {
                      "textRaw": "`value` {any}",
                      "name": "value",
                      "type": "any"
                    }
                  ]
                }
              ],
              "desc": "<p>Returns <code>true</code> if the value is a built-in <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet\"><code>WeakSet</code></a> instance.</p>\n<pre><code class=\"language-js\">util.types.isWeakSet(new WeakSet());  // Returns true\n</code></pre>"
            },
            {
              "textRaw": "`util.types.isWebAssemblyCompiledModule(value)`",
              "type": "method",
              "name": "isWebAssemblyCompiledModule",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  },
                  "params": [
                    {
                      "textRaw": "`value` {any}",
                      "name": "value",
                      "type": "any"
                    }
                  ]
                }
              ],
              "desc": "<p>Returns <code>true</code> if the value is a built-in <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Module\"><code>WebAssembly.Module</code></a> instance.</p>\n<pre><code class=\"language-js\">const module = new WebAssembly.Module(wasmBuffer);\nutil.types.isWebAssemblyCompiledModule(module);  // Returns true\n</code></pre>"
            }
          ]
        }
      ],
      "modules": [
        {
          "textRaw": "Deprecated APIs",
          "name": "deprecated_apis",
          "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)`",
              "type": "method",
              "name": "_extend",
              "meta": {
                "added": [
                  "v0.7.5"
                ],
                "deprecated": [
                  "v6.0.0"
                ],
                "changes": []
              },
              "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>"
            },
            {
              "textRaw": "`util.isArray(object)`",
              "type": "method",
              "name": "isArray",
              "meta": {
                "added": [
                  "v0.6.0"
                ],
                "deprecated": [
                  "v4.0.0"
                ],
                "changes": []
              },
              "stability": 0,
              "stabilityText": "Deprecated: Use [`Array.isArray()`][] instead.",
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  },
                  "params": [
                    {
                      "textRaw": "`object` {any}",
                      "name": "object",
                      "type": "any"
                    }
                  ]
                }
              ],
              "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('util');\n\nutil.isArray([]);\n// Returns: true\nutil.isArray(new Array());\n// Returns: true\nutil.isArray({});\n// Returns: false\n</code></pre>"
            },
            {
              "textRaw": "`util.isBoolean(object)`",
              "type": "method",
              "name": "isBoolean",
              "meta": {
                "added": [
                  "v0.11.5"
                ],
                "deprecated": [
                  "v4.0.0"
                ],
                "changes": []
              },
              "stability": 0,
              "stabilityText": "Deprecated: Use `typeof value === 'boolean'` instead.",
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  },
                  "params": [
                    {
                      "textRaw": "`object` {any}",
                      "name": "object",
                      "type": "any"
                    }
                  ]
                }
              ],
              "desc": "<p>Returns <code>true</code> if the given <code>object</code> is a <code>Boolean</code>. Otherwise, returns <code>false</code>.</p>\n<pre><code class=\"language-js\">const util = require('util');\n\nutil.isBoolean(1);\n// Returns: false\nutil.isBoolean(0);\n// Returns: false\nutil.isBoolean(false);\n// Returns: true\n</code></pre>"
            },
            {
              "textRaw": "`util.isBuffer(object)`",
              "type": "method",
              "name": "isBuffer",
              "meta": {
                "added": [
                  "v0.11.5"
                ],
                "deprecated": [
                  "v4.0.0"
                ],
                "changes": []
              },
              "stability": 0,
              "stabilityText": "Deprecated: Use [`Buffer.isBuffer()`][] instead.",
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  },
                  "params": [
                    {
                      "textRaw": "`object` {any}",
                      "name": "object",
                      "type": "any"
                    }
                  ]
                }
              ],
              "desc": "<p>Returns <code>true</code> if the given <code>object</code> is a <code>Buffer</code>. Otherwise, returns <code>false</code>.</p>\n<pre><code class=\"language-js\">const util = require('util');\n\nutil.isBuffer({ length: 0 });\n// Returns: false\nutil.isBuffer([]);\n// Returns: false\nutil.isBuffer(Buffer.from('hello world'));\n// Returns: true\n</code></pre>"
            },
            {
              "textRaw": "`util.isDate(object)`",
              "type": "method",
              "name": "isDate",
              "meta": {
                "added": [
                  "v0.6.0"
                ],
                "deprecated": [
                  "v4.0.0"
                ],
                "changes": []
              },
              "stability": 0,
              "stabilityText": "Deprecated: Use [`util.types.isDate()`][] instead.",
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  },
                  "params": [
                    {
                      "textRaw": "`object` {any}",
                      "name": "object",
                      "type": "any"
                    }
                  ]
                }
              ],
              "desc": "<p>Returns <code>true</code> if the given <code>object</code> is a <code>Date</code>. Otherwise, returns <code>false</code>.</p>\n<pre><code class=\"language-js\">const util = require('util');\n\nutil.isDate(new Date());\n// Returns: true\nutil.isDate(Date());\n// false (without 'new' returns a String)\nutil.isDate({});\n// Returns: false\n</code></pre>"
            },
            {
              "textRaw": "`util.isError(object)`",
              "type": "method",
              "name": "isError",
              "meta": {
                "added": [
                  "v0.6.0"
                ],
                "deprecated": [
                  "v4.0.0"
                ],
                "changes": []
              },
              "stability": 0,
              "stabilityText": "Deprecated: Use [`util.types.isNativeError()`][] instead.",
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  },
                  "params": [
                    {
                      "textRaw": "`object` {any}",
                      "name": "object",
                      "type": "any"
                    }
                  ]
                }
              ],
              "desc": "<p>Returns <code>true</code> if the given <code>object</code> is an <a href=\"errors.html#errors_class_error\"><code>Error</code></a>. Otherwise, returns\n<code>false</code>.</p>\n<pre><code class=\"language-js\">const util = require('util');\n\nutil.isError(new Error());\n// Returns: true\nutil.isError(new TypeError());\n// Returns: true\nutil.isError({ name: 'Error', message: 'an error occurred' });\n// Returns: false\n</code></pre>\n<p>This method relies on <code>Object.prototype.toString()</code> behavior. It is\npossible to obtain an incorrect result when the <code>object</code> argument manipulates\n<code>@@toStringTag</code>.</p>\n<pre><code class=\"language-js\">const util = require('util');\nconst obj = { name: 'Error', message: 'an error occurred' };\n\nutil.isError(obj);\n// Returns: false\nobj[Symbol.toStringTag] = 'Error';\nutil.isError(obj);\n// Returns: true\n</code></pre>"
            },
            {
              "textRaw": "`util.isFunction(object)`",
              "type": "method",
              "name": "isFunction",
              "meta": {
                "added": [
                  "v0.11.5"
                ],
                "deprecated": [
                  "v4.0.0"
                ],
                "changes": []
              },
              "stability": 0,
              "stabilityText": "Deprecated: Use `typeof value === 'function'` instead.",
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  },
                  "params": [
                    {
                      "textRaw": "`object` {any}",
                      "name": "object",
                      "type": "any"
                    }
                  ]
                }
              ],
              "desc": "<p>Returns <code>true</code> if the given <code>object</code> is a <code>Function</code>. Otherwise, returns\n<code>false</code>.</p>\n<pre><code class=\"language-js\">const util = require('util');\n\nfunction Foo() {}\nconst Bar = () => {};\n\nutil.isFunction({});\n// Returns: false\nutil.isFunction(Foo);\n// Returns: true\nutil.isFunction(Bar);\n// Returns: true\n</code></pre>"
            },
            {
              "textRaw": "`util.isNull(object)`",
              "type": "method",
              "name": "isNull",
              "meta": {
                "added": [
                  "v0.11.5"
                ],
                "deprecated": [
                  "v4.0.0"
                ],
                "changes": []
              },
              "stability": 0,
              "stabilityText": "Deprecated: Use `value === null` instead.",
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  },
                  "params": [
                    {
                      "textRaw": "`object` {any}",
                      "name": "object",
                      "type": "any"
                    }
                  ]
                }
              ],
              "desc": "<p>Returns <code>true</code> if the given <code>object</code> is strictly <code>null</code>. Otherwise, returns\n<code>false</code>.</p>\n<pre><code class=\"language-js\">const util = require('util');\n\nutil.isNull(0);\n// Returns: false\nutil.isNull(undefined);\n// Returns: false\nutil.isNull(null);\n// Returns: true\n</code></pre>"
            },
            {
              "textRaw": "`util.isNullOrUndefined(object)`",
              "type": "method",
              "name": "isNullOrUndefined",
              "meta": {
                "added": [
                  "v0.11.5"
                ],
                "deprecated": [
                  "v4.0.0"
                ],
                "changes": []
              },
              "stability": 0,
              "stabilityText": "Deprecated: Use\n`value === undefined || value === null` instead.",
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  },
                  "params": [
                    {
                      "textRaw": "`object` {any}",
                      "name": "object",
                      "type": "any"
                    }
                  ]
                }
              ],
              "desc": "<p>Returns <code>true</code> if the given <code>object</code> is <code>null</code> or <code>undefined</code>. Otherwise,\nreturns <code>false</code>.</p>\n<pre><code class=\"language-js\">const util = require('util');\n\nutil.isNullOrUndefined(0);\n// Returns: false\nutil.isNullOrUndefined(undefined);\n// Returns: true\nutil.isNullOrUndefined(null);\n// Returns: true\n</code></pre>"
            },
            {
              "textRaw": "`util.isNumber(object)`",
              "type": "method",
              "name": "isNumber",
              "meta": {
                "added": [
                  "v0.11.5"
                ],
                "deprecated": [
                  "v4.0.0"
                ],
                "changes": []
              },
              "stability": 0,
              "stabilityText": "Deprecated: Use `typeof value === 'number'` instead.",
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  },
                  "params": [
                    {
                      "textRaw": "`object` {any}",
                      "name": "object",
                      "type": "any"
                    }
                  ]
                }
              ],
              "desc": "<p>Returns <code>true</code> if the given <code>object</code> is a <code>Number</code>. Otherwise, returns <code>false</code>.</p>\n<pre><code class=\"language-js\">const util = require('util');\n\nutil.isNumber(false);\n// Returns: false\nutil.isNumber(Infinity);\n// Returns: true\nutil.isNumber(0);\n// Returns: true\nutil.isNumber(NaN);\n// Returns: true\n</code></pre>"
            },
            {
              "textRaw": "`util.isObject(object)`",
              "type": "method",
              "name": "isObject",
              "meta": {
                "added": [
                  "v0.11.5"
                ],
                "deprecated": [
                  "v4.0.0"
                ],
                "changes": []
              },
              "stability": 0,
              "stabilityText": "Deprecated:\nUse `value !== null && typeof value === 'object'` instead.",
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  },
                  "params": [
                    {
                      "textRaw": "`object` {any}",
                      "name": "object",
                      "type": "any"
                    }
                  ]
                }
              ],
              "desc": "<p>Returns <code>true</code> if the given <code>object</code> is strictly an <code>Object</code> <strong>and</strong> not a\n<code>Function</code> (even though functions are objects in JavaScript).\nOtherwise, returns <code>false</code>.</p>\n<pre><code class=\"language-js\">const util = require('util');\n\nutil.isObject(5);\n// Returns: false\nutil.isObject(null);\n// Returns: false\nutil.isObject({});\n// Returns: true\nutil.isObject(() => {});\n// Returns: false\n</code></pre>"
            },
            {
              "textRaw": "`util.isPrimitive(object)`",
              "type": "method",
              "name": "isPrimitive",
              "meta": {
                "added": [
                  "v0.11.5"
                ],
                "deprecated": [
                  "v4.0.0"
                ],
                "changes": []
              },
              "stability": 0,
              "stabilityText": "Deprecated: Use\n`(typeof value !== 'object' && typeof value !== 'function') || value === null`\ninstead.",
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  },
                  "params": [
                    {
                      "textRaw": "`object` {any}",
                      "name": "object",
                      "type": "any"
                    }
                  ]
                }
              ],
              "desc": "<p>Returns <code>true</code> if the given <code>object</code> is a primitive type. Otherwise, returns\n<code>false</code>.</p>\n<pre><code class=\"language-js\">const util = require('util');\n\nutil.isPrimitive(5);\n// Returns: true\nutil.isPrimitive('foo');\n// Returns: true\nutil.isPrimitive(false);\n// Returns: true\nutil.isPrimitive(null);\n// Returns: true\nutil.isPrimitive(undefined);\n// Returns: true\nutil.isPrimitive({});\n// Returns: false\nutil.isPrimitive(() => {});\n// Returns: false\nutil.isPrimitive(/^$/);\n// Returns: false\nutil.isPrimitive(new Date());\n// Returns: false\n</code></pre>"
            },
            {
              "textRaw": "`util.isRegExp(object)`",
              "type": "method",
              "name": "isRegExp",
              "meta": {
                "added": [
                  "v0.6.0"
                ],
                "deprecated": [
                  "v4.0.0"
                ],
                "changes": []
              },
              "stability": 0,
              "stabilityText": "Deprecated",
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  },
                  "params": [
                    {
                      "textRaw": "`object` {any}",
                      "name": "object",
                      "type": "any"
                    }
                  ]
                }
              ],
              "desc": "<p>Returns <code>true</code> if the given <code>object</code> is a <code>RegExp</code>. Otherwise, returns <code>false</code>.</p>\n<pre><code class=\"language-js\">const util = require('util');\n\nutil.isRegExp(/some regexp/);\n// Returns: true\nutil.isRegExp(new RegExp('another regexp'));\n// Returns: true\nutil.isRegExp({});\n// Returns: false\n</code></pre>"
            },
            {
              "textRaw": "`util.isString(object)`",
              "type": "method",
              "name": "isString",
              "meta": {
                "added": [
                  "v0.11.5"
                ],
                "deprecated": [
                  "v4.0.0"
                ],
                "changes": []
              },
              "stability": 0,
              "stabilityText": "Deprecated: Use `typeof value === 'string'` instead.",
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  },
                  "params": [
                    {
                      "textRaw": "`object` {any}",
                      "name": "object",
                      "type": "any"
                    }
                  ]
                }
              ],
              "desc": "<p>Returns <code>true</code> if the given <code>object</code> is a <code>string</code>. Otherwise, returns <code>false</code>.</p>\n<pre><code class=\"language-js\">const util = require('util');\n\nutil.isString('');\n// Returns: true\nutil.isString('foo');\n// Returns: true\nutil.isString(String('foo'));\n// Returns: true\nutil.isString(5);\n// Returns: false\n</code></pre>"
            },
            {
              "textRaw": "`util.isSymbol(object)`",
              "type": "method",
              "name": "isSymbol",
              "meta": {
                "added": [
                  "v0.11.5"
                ],
                "deprecated": [
                  "v4.0.0"
                ],
                "changes": []
              },
              "stability": 0,
              "stabilityText": "Deprecated: Use `typeof value === 'symbol'` instead.",
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  },
                  "params": [
                    {
                      "textRaw": "`object` {any}",
                      "name": "object",
                      "type": "any"
                    }
                  ]
                }
              ],
              "desc": "<p>Returns <code>true</code> if the given <code>object</code> is a <code>Symbol</code>. Otherwise, returns <code>false</code>.</p>\n<pre><code class=\"language-js\">const util = require('util');\n\nutil.isSymbol(5);\n// Returns: false\nutil.isSymbol('foo');\n// Returns: false\nutil.isSymbol(Symbol('foo'));\n// Returns: true\n</code></pre>"
            },
            {
              "textRaw": "`util.isUndefined(object)`",
              "type": "method",
              "name": "isUndefined",
              "meta": {
                "added": [
                  "v0.11.5"
                ],
                "deprecated": [
                  "v4.0.0"
                ],
                "changes": []
              },
              "stability": 0,
              "stabilityText": "Deprecated: Use `value === undefined` instead.",
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  },
                  "params": [
                    {
                      "textRaw": "`object` {any}",
                      "name": "object",
                      "type": "any"
                    }
                  ]
                }
              ],
              "desc": "<p>Returns <code>true</code> if the given <code>object</code> is <code>undefined</code>. Otherwise, returns <code>false</code>.</p>\n<pre><code class=\"language-js\">const util = require('util');\n\nconst foo = undefined;\nutil.isUndefined(5);\n// Returns: false\nutil.isUndefined(foo);\n// Returns: true\nutil.isUndefined(null);\n// Returns: false\n</code></pre>"
            },
            {
              "textRaw": "`util.log(string)`",
              "type": "method",
              "name": "log",
              "meta": {
                "added": [
                  "v0.3.0"
                ],
                "deprecated": [
                  "v6.0.0"
                ],
                "changes": []
              },
              "stability": 0,
              "stabilityText": "Deprecated: Use a third party module instead.",
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`string` {string}",
                      "name": "string",
                      "type": "string"
                    }
                  ]
                }
              ],
              "desc": "<p>The <code>util.log()</code> method prints the given <code>string</code> to <code>stdout</code> with an included\ntimestamp.</p>\n<pre><code class=\"language-js\">const util = require('util');\n\nutil.log('Timestamped message.');\n</code></pre>"
            }
          ],
          "type": "module",
          "displayName": "Deprecated APIs"
        }
      ],
      "type": "module",
      "displayName": "Util"
    },
    {
      "textRaw": "V8",
      "name": "v8",
      "introduced_in": "v4.0.0",
      "desc": "<p>The <code>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-js\">const v8 = require('v8');\n</code></pre>\n<p>The APIs and implementation are subject to change at any time.</p>",
      "methods": [
        {
          "textRaw": "`v8.cachedDataVersionTag()`",
          "type": "method",
          "name": "cachedDataVersionTag",
          "meta": {
            "added": [
              "v8.0.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "return": {
                "textRaw": "Returns: {integer}",
                "name": "return",
                "type": "integer"
              },
              "params": []
            }
          ],
          "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#vm_constructor_new_vm_script_code_options\"><code>vm.Script</code></a> <code>cachedData</code> buffer is compatible with this instance\nof V8.</p>"
        },
        {
          "textRaw": "`v8.getHeapSpaceStatistics()`",
          "type": "method",
          "name": "getHeapSpaceStatistics",
          "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": [
            {
              "return": {
                "textRaw": "Returns: {Object[]}",
                "name": "return",
                "type": "Object[]"
              },
              "params": []
            }
          ],
          "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/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string&gt;</a></li>\n<li><code>space_size</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;number&gt;</a></li>\n<li><code>space_used_size</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;number&gt;</a></li>\n<li><code>space_available_size</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;number&gt;</a></li>\n<li><code>physical_space_size</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;number&gt;</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.getHeapSnapshot()`",
          "type": "method",
          "name": "getHeapSnapshot",
          "meta": {
            "added": [
              "v11.13.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "return": {
                "textRaw": "Returns: {stream.Readable} A Readable Stream containing the V8 heap snapshot",
                "name": "return",
                "type": "stream.Readable",
                "desc": "A Readable Stream containing the V8 heap snapshot"
              },
              "params": []
            }
          ],
          "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, and may change from one version of V8 to the next.</p>\n<pre><code class=\"language-js\">const stream = v8.getHeapSnapshot();\nstream.pipe(process.stdout);\n</code></pre>"
        },
        {
          "textRaw": "`v8.getHeapStatistics()`",
          "type": "method",
          "name": "getHeapStatistics",
          "meta": {
            "added": [
              "v1.0.0"
            ],
            "changes": [
              {
                "version": "v7.2.0",
                "pr-url": "https://github.com/nodejs/node/pull/8610",
                "description": "Added `malloced_memory`, `peak_malloced_memory`, and `does_zap_garbage`."
              },
              {
                "version": "v7.5.0",
                "pr-url": "https://github.com/nodejs/node/pull/10186",
                "description": "Support values exceeding the 32-bit unsigned integer range."
              }
            ]
          },
          "signatures": [
            {
              "return": {
                "textRaw": "Returns: {Object}",
                "name": "return",
                "type": "Object"
              },
              "params": []
            }
          ],
          "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/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;number&gt;</a></li>\n<li><code>total_heap_size_executable</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;number&gt;</a></li>\n<li><code>total_physical_size</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;number&gt;</a></li>\n<li><code>total_available_size</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;number&gt;</a></li>\n<li><code>used_heap_size</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;number&gt;</a></li>\n<li><code>heap_size_limit</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;number&gt;</a></li>\n<li><code>malloced_memory</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;number&gt;</a></li>\n<li><code>peak_malloced_memory</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;number&gt;</a></li>\n<li><code>does_zap_garbage</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;number&gt;</a></li>\n<li><code>number_of_native_contexts</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;number&gt;</a></li>\n<li><code>number_of_detached_contexts</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;number&gt;</a></li>\n</ul>\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 memory set) 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<!-- eslint-skip -->\n<pre><code class=\"language-js\">{\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}\n</code></pre>"
        },
        {
          "textRaw": "`v8.getHeapCodeStatistics()`",
          "type": "method",
          "name": "getHeapCodeStatistics",
          "meta": {
            "added": [
              "v12.8.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "return": {
                "textRaw": "Returns: {Object}",
                "name": "return",
                "type": "Object"
              },
              "params": []
            }
          ],
          "desc": "<p>Returns an object with the following properties:</p>\n<ul>\n<li><code>code_and_metadata_size</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;number&gt;</a></li>\n<li><code>bytecode_and_metadata_size</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;number&gt;</a></li>\n<li><code>external_script_source_size</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;number&gt;</a></li>\n</ul>\n<!-- eslint-skip -->\n<pre><code class=\"language-js\">{\n  code_and_metadata_size: 212208,\n  bytecode_and_metadata_size: 161368,\n  external_script_source_size: 1410794\n}\n</code></pre>"
        },
        {
          "textRaw": "`v8.setFlagsFromString(flags)`",
          "type": "method",
          "name": "setFlagsFromString",
          "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-js\">// Print GC events to stdout for one minute.\nconst v8 = require('v8');\nv8.setFlagsFromString('--trace_gc');\nsetTimeout(() => { v8.setFlagsFromString('--notrace_gc'); }, 60e3);\n</code></pre>"
        },
        {
          "textRaw": "`v8.writeHeapSnapshot([filename])`",
          "type": "method",
          "name": "writeHeapSnapshot",
          "meta": {
            "added": [
              "v11.13.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "return": {
                "textRaw": "Returns: {string} The filename where the snapshot was saved.",
                "name": "return",
                "type": "string",
                "desc": "The filename where the snapshot was saved."
              },
              "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."
                }
              ]
            }
          ],
          "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<pre><code class=\"language-js\">const { writeHeapSnapshot } = require('v8');\nconst {\n  Worker,\n  isMainThread,\n  parentPort\n} = require('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>"
        }
      ],
      "modules": [
        {
          "textRaw": "Serialization API",
          "name": "serialization_api",
          "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)`",
              "type": "method",
              "name": "serialize",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Buffer}",
                    "name": "return",
                    "type": "Buffer"
                  },
                  "params": [
                    {
                      "textRaw": "`value` {any}",
                      "name": "value",
                      "type": "any"
                    }
                  ]
                }
              ],
              "desc": "<p>Uses a <a href=\"v8.html#v8_class_v8_defaultserializer\"><code>DefaultSerializer</code></a> to serialize <code>value</code> into a buffer.</p>"
            },
            {
              "textRaw": "`v8.deserialize(buffer)`",
              "type": "method",
              "name": "deserialize",
              "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=\"v8.html#v8_class_v8_defaultdeserializer\"><code>DefaultDeserializer</code></a> with default options to read a JS value\nfrom a buffer.</p>"
            }
          ],
          "classes": [
            {
              "textRaw": "Class: `v8.Serializer`",
              "type": "class",
              "name": "v8.Serializer",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "changes": []
              },
              "methods": [
                {
                  "textRaw": "`serializer.writeHeader()`",
                  "type": "method",
                  "name": "writeHeader",
                  "signatures": [
                    {
                      "params": []
                    }
                  ],
                  "desc": "<p>Writes out a header, which includes the serialization format version.</p>"
                },
                {
                  "textRaw": "`serializer.writeValue(value)`",
                  "type": "method",
                  "name": "writeValue",
                  "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()`",
                  "type": "method",
                  "name": "releaseBuffer",
                  "signatures": [
                    {
                      "return": {
                        "textRaw": "Returns: {Buffer}",
                        "name": "return",
                        "type": "Buffer"
                      },
                      "params": []
                    }
                  ],
                  "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)`",
                  "type": "method",
                  "name": "transferArrayBuffer",
                  "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=\"v8.html#v8_deserializer_transferarraybuffer_id_arraybuffer\"><code>deserializer.transferArrayBuffer()</code></a>.</p>"
                },
                {
                  "textRaw": "`serializer.writeUint32(value)`",
                  "type": "method",
                  "name": "writeUint32",
                  "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=\"v8.html#v8_serializer_writehostobject_object\"><code>serializer._writeHostObject()</code></a>.</p>"
                },
                {
                  "textRaw": "`serializer.writeUint64(hi, lo)`",
                  "type": "method",
                  "name": "writeUint64",
                  "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=\"v8.html#v8_serializer_writehostobject_object\"><code>serializer._writeHostObject()</code></a>.</p>"
                },
                {
                  "textRaw": "`serializer.writeDouble(value)`",
                  "type": "method",
                  "name": "writeDouble",
                  "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=\"v8.html#v8_serializer_writehostobject_object\"><code>serializer._writeHostObject()</code></a>.</p>"
                },
                {
                  "textRaw": "`serializer.writeRawBytes(buffer)`",
                  "type": "method",
                  "name": "writeRawBytes",
                  "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=\"v8.html#v8_serializer_writehostobject_object\"><code>serializer._writeHostObject()</code></a>.</p>"
                },
                {
                  "textRaw": "`serializer._writeHostObject(object)`",
                  "type": "method",
                  "name": "_writeHostObject",
                  "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)`",
                  "type": "method",
                  "name": "_getDataCloneError",
                  "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#errors_class_error\"><code>Error</code></a> constructor and can be overridden on\nsubclasses.</p>"
                },
                {
                  "textRaw": "`serializer._getSharedArrayBufferId(sharedArrayBuffer)`",
                  "type": "method",
                  "name": "_getSharedArrayBufferId",
                  "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=\"v8.html#v8_deserializer_transferarraybuffer_id_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)`",
                  "type": "method",
                  "name": "_setTreatArrayBufferViewsAsHostObjects",
                  "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=\"v8.html#v8_serializer_writehostobject_object\"><code>serializer._writeHostObject()</code></a>.</p>"
                }
              ],
              "signatures": [
                {
                  "params": [],
                  "desc": "<p>Creates a new <code>Serializer</code> object.</p>"
                }
              ]
            },
            {
              "textRaw": "Class: `v8.Deserializer`",
              "type": "class",
              "name": "v8.Deserializer",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "changes": []
              },
              "methods": [
                {
                  "textRaw": "`deserializer.readHeader()`",
                  "type": "method",
                  "name": "readHeader",
                  "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()`",
                  "type": "method",
                  "name": "readValue",
                  "signatures": [
                    {
                      "params": []
                    }
                  ],
                  "desc": "<p>Deserializes a JavaScript value from the buffer and returns it.</p>"
                },
                {
                  "textRaw": "`deserializer.transferArrayBuffer(id, arrayBuffer)`",
                  "type": "method",
                  "name": "transferArrayBuffer",
                  "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=\"v8.html#v8_serializer_transferarraybuffer_id_arraybuffer\"><code>serializer.transferArrayBuffer()</code></a> (or return the <code>id</code> from\n<a href=\"v8.html#v8_serializer_getsharedarraybufferid_sharedarraybuffer\"><code>serializer._getSharedArrayBufferId()</code></a> in the case of <code>SharedArrayBuffer</code>s).</p>"
                },
                {
                  "textRaw": "`deserializer.getWireFormatVersion()`",
                  "type": "method",
                  "name": "getWireFormatVersion",
                  "signatures": [
                    {
                      "return": {
                        "textRaw": "Returns: {integer}",
                        "name": "return",
                        "type": "integer"
                      },
                      "params": []
                    }
                  ],
                  "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()`",
                  "type": "method",
                  "name": "readUint32",
                  "signatures": [
                    {
                      "return": {
                        "textRaw": "Returns: {integer}",
                        "name": "return",
                        "type": "integer"
                      },
                      "params": []
                    }
                  ],
                  "desc": "<p>Read a raw 32-bit unsigned integer and return it.\nFor use inside of a custom <a href=\"v8.html#v8_deserializer_readhostobject\"><code>deserializer._readHostObject()</code></a>.</p>"
                },
                {
                  "textRaw": "`deserializer.readUint64()`",
                  "type": "method",
                  "name": "readUint64",
                  "signatures": [
                    {
                      "return": {
                        "textRaw": "Returns: {integer[]}",
                        "name": "return",
                        "type": "integer[]"
                      },
                      "params": []
                    }
                  ],
                  "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=\"v8.html#v8_deserializer_readhostobject\"><code>deserializer._readHostObject()</code></a>.</p>"
                },
                {
                  "textRaw": "`deserializer.readDouble()`",
                  "type": "method",
                  "name": "readDouble",
                  "signatures": [
                    {
                      "return": {
                        "textRaw": "Returns: {number}",
                        "name": "return",
                        "type": "number"
                      },
                      "params": []
                    }
                  ],
                  "desc": "<p>Read a JS <code>number</code> value.\nFor use inside of a custom <a href=\"v8.html#v8_deserializer_readhostobject\"><code>deserializer._readHostObject()</code></a>.</p>"
                },
                {
                  "textRaw": "`deserializer.readRawBytes(length)`",
                  "type": "method",
                  "name": "readRawBytes",
                  "signatures": [
                    {
                      "return": {
                        "textRaw": "Returns: {Buffer}",
                        "name": "return",
                        "type": "Buffer"
                      },
                      "params": [
                        {
                          "textRaw": "`length` {integer}",
                          "name": "length",
                          "type": "integer"
                        }
                      ]
                    }
                  ],
                  "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=\"v8.html#v8_serializer_writerawbytes_buffer\"><code>serializer.writeRawBytes()</code></a>.\nFor use inside of a custom <a href=\"v8.html#v8_deserializer_readhostobject\"><code>deserializer._readHostObject()</code></a>.</p>"
                },
                {
                  "textRaw": "`deserializer._readHostObject()`",
                  "type": "method",
                  "name": "_readHostObject",
                  "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>"
                }
              ],
              "signatures": [
                {
                  "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>"
                }
              ]
            },
            {
              "textRaw": "Class: `v8.DefaultSerializer`",
              "type": "class",
              "name": "v8.DefaultSerializer",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "changes": []
              },
              "desc": "<p>A subclass of <a href=\"v8.html#v8_class_v8_serializer\"><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`",
              "type": "class",
              "name": "v8.DefaultDeserializer",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "changes": []
              },
              "desc": "<p>A subclass of <a href=\"v8.html#v8_class_v8_deserializer\"><code>Deserializer</code></a> corresponding to the format written by\n<a href=\"v8.html#v8_class_v8_defaultserializer\"><code>DefaultSerializer</code></a>.</p>"
            }
          ],
          "type": "module",
          "displayName": "Serialization API"
        }
      ],
      "type": "module",
      "displayName": "V8"
    },
    {
      "textRaw": "VM (executing JavaScript)",
      "name": "vm",
      "introduced_in": "v0.10.0",
      "stability": 2,
      "stabilityText": "Stable",
      "desc": "<p>The <code>vm</code> module enables compiling and running code within V8 Virtual\nMachine contexts. <strong>The <code>vm</code> module is not a security mechanism. Do\nnot 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=\"vm.html#vm_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-js\">const vm = require('vm');\n\nconst x = 1;\n\nconst context = { x: 2 };\nvm.createContext(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.\nvm.runInContext(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`",
          "type": "class",
          "name": "vm.Script",
          "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>",
          "methods": [
            {
              "textRaw": "`script.createCachedData()`",
              "type": "method",
              "name": "createCachedData",
              "meta": {
                "added": [
                  "v10.6.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Buffer}",
                    "name": "return",
                    "type": "Buffer"
                  },
                  "params": []
                }
              ],
              "desc": "<p>Creates a code cache that can be used with the Script constructor's\n<code>cachedData</code> option. Returns a Buffer. This method may be called at any\ntime and any number of times.</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 cacheWithoutX = script.createCachedData();\n\nscript.runInThisContext();\n\nconst cacheWithX = script.createCachedData();\n</code></pre>"
            },
            {
              "textRaw": "`script.runInContext(contextifiedObject[, options])`",
              "type": "method",
              "name": "runInContext",
              "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": [
                {
                  "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."
                  },
                  "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`, the execution will be terminated when `SIGINT` (Ctrl+C) is received. Existing handlers for the event that have been attached via `process.on('SIGINT')` will be disabled during script execution, but will continue to work after that. If execution is terminated, an [`Error`][] will be thrown. **Default:** `false`.",
                          "name": "breakOnSigint",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "If `true`, the execution will be terminated when `SIGINT` (Ctrl+C) is received. Existing handlers for the event that have been attached via `process.on('SIGINT')` will be disabled during script execution, but will continue to work after that. If execution is terminated, an [`Error`][] will be thrown."
                        }
                      ]
                    }
                  ]
                }
              ],
              "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-js\">const vm = require('vm');\n\nconst context = {\n  animal: 'cat',\n  count: 2\n};\n\nconst script = new vm.Script('count += 1; name = \"kitty\";');\n\nvm.createContext(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]])`",
              "type": "method",
              "name": "runInNewContext",
              "meta": {
                "added": [
                  "v0.3.1"
                ],
                "changes": [
                  {
                    "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": [
                {
                  "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."
                  },
                  "params": [
                    {
                      "textRaw": "`contextObject` {Object} An object that will be [contextified][]. If `undefined`, a new object will be created.",
                      "name": "contextObject",
                      "type": "Object",
                      "desc": "An object that will be [contextified][]. If `undefined`, a new object will be created."
                    },
                    {
                      "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`, the execution will be terminated when `SIGINT` (Ctrl+C) is received. Existing handlers for the event that have been attached via `process.on('SIGINT')` will be disabled during script execution, but will continue to work after that. If execution is terminated, an [`Error`][] will be thrown. **Default:** `false`.",
                          "name": "breakOnSigint",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "If `true`, the execution will be terminated when `SIGINT` (Ctrl+C) is received. Existing handlers for the event that have been attached via `process.on('SIGINT')` will be disabled during script execution, but will continue to work after that. If execution is terminated, an [`Error`][] will be thrown."
                        },
                        {
                          "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][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][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`."
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>First contextifies the given <code>contextObject</code>, runs the compiled code contained\nby the <code>vm.Script</code> object within the created context, and returns the result.\nRunning code does not have access to local scope.</p>\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-js\">const vm = require('vm');\n\nconst script = new vm.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</code></pre>"
            },
            {
              "textRaw": "`script.runInThisContext([options])`",
              "type": "method",
              "name": "runInThisContext",
              "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": [
                {
                  "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."
                  },
                  "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`, the execution will be terminated when `SIGINT` (Ctrl+C) is received. Existing handlers for the event that have been attached via `process.on('SIGINT')` will be disabled during script execution, but will continue to work after that. If execution is terminated, an [`Error`][] will be thrown. **Default:** `false`.",
                          "name": "breakOnSigint",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "If `true`, the execution will be terminated when `SIGINT` (Ctrl+C) is received. Existing handlers for the event that have been attached via `process.on('SIGINT')` will be disabled during script execution, but will continue to work after that. If execution is terminated, an [`Error`][] will be thrown."
                        }
                      ]
                    }
                  ]
                }
              ],
              "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-js\">const vm = require('vm');\n\nglobal.globalVar = 0;\n\nconst script = new vm.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>"
            }
          ],
          "signatures": [
            {
              "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 column number offset that is displayed in stack traces produced by this script. **Default:** `0`.",
                      "name": "columnOffset",
                      "type": "number",
                      "default": "`0`",
                      "desc": "Specifies the 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} Called during evaluation of this module when `import()` is called. If this option is not specified, calls to `import()` will reject with [`ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING`][]. This option is part of the experimental modules API, and should not be considered stable.",
                      "name": "importModuleDynamically",
                      "type": "Function",
                      "desc": "Called during evaluation of this module when `import()` is called. If this option is not specified, calls to `import()` will reject with [`ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING`][]. This option is part of the experimental modules API, and should not be considered stable.",
                      "options": [
                        {
                          "textRaw": "`specifier` {string} specifier passed to `import()`",
                          "name": "specifier",
                          "type": "string",
                          "desc": "specifier passed to `import()`"
                        },
                        {
                          "textRaw": "`module` {vm.Module}",
                          "name": "module",
                          "type": "vm.Module"
                        },
                        {
                          "textRaw": "Returns: {Module Namespace Object|vm.Module} Returning a `vm.Module` is recommended in order to take advantage of error tracking, and to avoid issues with namespaces that contain `then` function exports.",
                          "name": "return",
                          "type": "Module Namespace Object|vm.Module",
                          "desc": "Returning a `vm.Module` is recommended in order to take advantage of error tracking, and to avoid issues with namespaces that contain `then` function exports."
                        }
                      ]
                    }
                  ]
                }
              ],
              "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>"
            }
          ]
        },
        {
          "textRaw": "Class: `vm.Module`",
          "type": "class",
          "name": "vm.Module",
          "meta": {
            "added": [
              "v12.16.0"
            ],
            "changes": []
          },
          "stability": 1,
          "stabilityText": "Experimental",
          "desc": "<p><em>This feature is only available with the <code>--experimental-vm-modules</code> command\nflag enabled.</em></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://www.ecma-international.org/ecma-262/#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. Operations on <code>vm.Module</code> objects are intrinsically asynchronous,\nin contrast with the synchronous nature of <code>vm.Script</code> objects. The use of\n'async' functions can help with manipulating <code>vm.Module</code> objects.</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#esm_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-js\">const vm = require('vm');\n\nconst contextifiedObject = vm.createContext({ secret: 42 });\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 bar = new vm.SourceTextModule(`\n    import s from 'foo';\n    s;\n  `, { context: contextifiedObject });\n\n  // Step 2\n  //\n  // \"Link\" the imported dependencies of this Module to it.\n  //\n  // The provided linking callback (the \"linker\") accepts two arguments: the\n  // parent module (`bar` in this case) and the string that is the specifier of\n  // the imported module. The callback is expected to return a Module that\n  // corresponds to the provided specifier, with certain requirements documented\n  // in `module.link()`.\n  //\n  // If linking has not started for the returned Module, the same linker\n  // callback will be called on the returned Module.\n  //\n  // Even top-level Modules without dependencies must be explicitly linked. The\n  // callback provided would never be called, however.\n  //\n  // The link() method returns a Promise that will be resolved when all the\n  // Promises returned by the linker resolve.\n  //\n  // Note: This is a contrived example in that the linker function creates a new\n  // \"foo\" module every time it is called. In a full-fledged module system, a\n  // cache would probably be used to avoid duplicated modules.\n\n  async function linker(specifier, referencingModule) {\n    if (specifier === 'foo') {\n      return 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: referencingModule.context });\n\n      // Using `contextifiedObject` instead of `referencingModule.context`\n      // here would work as well.\n    }\n    throw new Error(`Unable to resolve dependency: ${specifier}`);\n  }\n  await bar.link(linker);\n\n  // Step 3\n  //\n  // Evaluate the Module. The evaluate() method returns a Promise with a single\n  // property \"result\" that contains the result of the very last statement\n  // executed in the Module. In the case of `bar`, it is `s;`, which refers to\n  // the default export of the `foo` module, the `secret` we set in the\n  // beginning to 42.\n\n  const { result } = await bar.evaluate();\n\n  console.log(result);\n  // Prints 42.\n})();\n</code></pre>",
          "properties": [
            {
              "textRaw": "`dependencySpecifiers` {string[]}",
              "type": "string[]",
              "name": "dependencySpecifiers",
              "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": "`error` {any}",
              "type": "any",
              "name": "error",
              "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": "`namespace` {Object}",
              "type": "Object",
              "name": "namespace",
              "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": "`status` {string}",
              "type": "string",
              "name": "status",
              "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>"
            },
            {
              "textRaw": "`identifier` {string}",
              "type": "string",
              "name": "identifier",
              "desc": "<p>The identifier of the current module, as set in the constructor.</p>"
            }
          ],
          "methods": [
            {
              "textRaw": "`module.evaluate([options])`",
              "type": "method",
              "name": "evaluate",
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Promise}",
                    "name": "return",
                    "type": "Promise"
                  },
                  "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`, the execution will be terminated when `SIGINT` (Ctrl+C) is received. Existing handlers for the event that have been attached via `process.on('SIGINT')` will be disabled during script execution, but will continue to work after that. If execution is interrupted, an [`Error`][] will be thrown. **Default:** `false`.",
                          "name": "breakOnSigint",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "If `true`, the execution will be terminated when `SIGINT` (Ctrl+C) is received. Existing handlers for the event that have been attached via `process.on('SIGINT')` will be disabled during script execution, but will continue to work after that. If execution is interrupted, an [`Error`][] will be thrown."
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Evaluate the module.</p>\n<p>This must be called after the module has been linked; otherwise it will\nthrow an error. It could be called also when the module has already been\nevaluated, in which case it will do one of the following two things:</p>\n<ul>\n<li>return <code>undefined</code> if the initial evaluation ended in success (<code>module.status</code>\nis <code>'evaluated'</code>)</li>\n<li>rethrow the same exception the initial evaluation threw if the initial\nevaluation ended in an error (<code>module.status</code> is <code>'errored'</code>)</li>\n</ul>\n<p>This method cannot be called while the module is being evaluated\n(<code>module.status</code> is <code>'evaluating'</code>) to prevent infinite recursion.</p>\n<p>Corresponds to the <a href=\"https://tc39.es/ecma262/#sec-moduleevaluation\">Evaluate() 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": "`module.link(linker)`",
              "type": "method",
              "name": "link",
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Promise}",
                    "name": "return",
                    "type": "Promise"
                  },
                  "params": [
                    {
                      "textRaw": "`linker` {Function}",
                      "name": "linker",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`specifier` {string} The specifier of the requested module:```js import foo from 'foo'; // ^^^^^ the module specifier ```",
                          "name": "specifier",
                          "type": "string",
                          "desc": "The specifier of the requested module:```js 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": "Returns: {vm.Module|Promise}",
                          "name": "return",
                          "type": "vm.Module|Promise"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Link module dependencies. This method must be called before evaluation, and\ncan only be called once per module.</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`",
          "type": "class",
          "name": "vm.SourceTextModule",
          "meta": {
            "added": [
              "v9.6.0"
            ],
            "changes": []
          },
          "stability": 1,
          "stabilityText": "Experimental",
          "desc": "<p><em>This feature is only available with the <code>--experimental-vm-modules</code> command\nflag enabled.</em></p>\n<ul>\n<li>Extends: <a href=\"vm.html#vm_class_vm_module\" class=\"type\">&lt;vm.Module&gt;</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>",
          "methods": [
            {
              "textRaw": "`sourceTextModule.createCachedData()`",
              "type": "method",
              "name": "createCachedData",
              "meta": {
                "added": [
                  "v12.17.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Buffer}",
                    "name": "return",
                    "type": "Buffer"
                  },
                  "params": []
                }
              ],
              "desc": "<p>Creates a code cache that can be used with the SourceTextModule constructor's\n<code>cachedData</code> option. Returns a Buffer. This method may be called any number\nof times before the module has been evaluated.</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>"
            }
          ],
          "signatures": [
            {
              "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.",
                      "name": "context",
                      "type": "Object",
                      "desc": "The [contextified][] object as returned by the `vm.createContext()` method, to compile and evaluate this `Module` in."
                    },
                    {
                      "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 column number offset that is displayed in stack traces produced by this `Module`. **Default:** `0`.",
                      "name": "columnOffset",
                      "type": "integer",
                      "default": "`0`",
                      "desc": "Specifies the 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} Called during evaluation of this module when `import()` is called. If this option is not specified, calls to `import()` will reject with [`ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING`][].",
                      "name": "importModuleDynamically",
                      "type": "Function",
                      "desc": "Called during evaluation of this module when `import()` is called. If this option is not specified, calls to `import()` will reject with [`ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING`][].",
                      "options": [
                        {
                          "textRaw": "`specifier` {string} specifier passed to `import()`",
                          "name": "specifier",
                          "type": "string",
                          "desc": "specifier passed to `import()`"
                        },
                        {
                          "textRaw": "`module` {vm.Module}",
                          "name": "module",
                          "type": "vm.Module"
                        },
                        {
                          "textRaw": "Returns: {Module Namespace Object|vm.Module} Returning a `vm.Module` is recommended in order to take advantage of error tracking, and to avoid issues with namespaces that contain `then` function exports.",
                          "name": "return",
                          "type": "Module Namespace Object|vm.Module",
                          "desc": "Returning a `vm.Module` is recommended in order to take advantage of error tracking, and to avoid issues with namespaces that contain `then` function exports."
                        }
                      ]
                    }
                  ]
                }
              ],
              "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-js\">const vm = require('vm');\n\nconst contextifiedObject = vm.createContext({ secret: 42 });\n\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  // Since module has no dependencies, the linker function will never be called.\n  await module.link(() => {});\n  await 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})();\n</code></pre>"
            }
          ]
        },
        {
          "textRaw": "Class: `vm.SyntheticModule`",
          "type": "class",
          "name": "vm.SyntheticModule",
          "meta": {
            "added": [
              "v12.16.0"
            ],
            "changes": []
          },
          "stability": 1,
          "stabilityText": "Experimental",
          "desc": "<p><em>This feature is only available with the <code>--experimental-vm-modules</code> command\nflag enabled.</em></p>\n<ul>\n<li>Extends: <a href=\"vm.html#vm_class_vm_module\" class=\"type\">&lt;vm.Module&gt;</a></li>\n</ul>\n<p>The <code>vm.SyntheticModule</code> class provides the <a href=\"https://heycam.github.io/webidl/#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-js\">const vm = require('vm');\n\nconst source = '{ \"a\": 1 }';\nconst module = new vm.SyntheticModule(['default'], function() {\n  const obj = JSON.parse(source);\n  this.setExport('default', obj);\n});\n\n// Use `module` in linking...\n</code></pre>",
          "methods": [
            {
              "textRaw": "`syntheticModule.setExport(name, value)`",
              "type": "method",
              "name": "setExport",
              "meta": {
                "added": [
                  "v12.16.0"
                ],
                "changes": []
              },
              "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 is used after the module is linked to set the values of exports. If\nit is called before the module is linked, an <a href=\"errors.html#ERR_VM_MODULE_STATUS\"><code>ERR_VM_MODULE_STATUS</code></a> error\nwill be thrown.</p>\n<pre><code class=\"language-js\">const vm = require('vm');\n\n(async () => {\n  const m = new vm.SyntheticModule(['x'], () => {\n    m.setExport('x', 1);\n  });\n\n  await m.link(() => {});\n  await m.evaluate();\n\n  assert.strictEqual(m.namespace.x, 1);\n})();\n</code></pre>"
            }
          ],
          "signatures": [
            {
              "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."
                    }
                  ]
                }
              ],
              "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": "`vm.compileFunction(code[, params[, options]])`",
          "type": "method",
          "name": "compileFunction",
          "meta": {
            "added": [
              "v10.10.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "return": {
                "textRaw": "Returns: {Function}",
                "name": "return",
                "type": "Function"
              },
              "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."
                },
                {
                  "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 column number offset that is displayed in stack traces produced by this script. **Default:** `0`.",
                      "name": "columnOffset",
                      "type": "number",
                      "default": "`0`",
                      "desc": "Specifies the 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.",
                      "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": "`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."
                    }
                  ]
                }
              ]
            }
          ],
          "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]])`",
          "type": "method",
          "name": "createContext",
          "meta": {
            "added": [
              "v0.3.1"
            ],
            "changes": [
              {
                "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": [
            {
              "return": {
                "textRaw": "Returns: {Object} contextified object.",
                "name": "return",
                "type": "Object",
                "desc": "contextified object."
              },
              "params": [
                {
                  "textRaw": "`contextObject` {Object}",
                  "name": "contextObject",
                  "type": "Object"
                },
                {
                  "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][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][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`."
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ],
          "desc": "<p>If given a <code>contextObject</code>, the <code>vm.createContext()</code> method will <a href=\"vm.html#vm_what_does_it_mean_to_contextify_an_object\">prepare\nthat object</a> so that it can be used in calls to\n<a href=\"vm.html#vm_vm_runincontext_code_contextifiedobject_options\"><code>vm.runInContext()</code></a> or <a href=\"vm.html#vm_script_runincontext_contextifiedobject_options\"><code>script.runInContext()</code></a>. Inside such scripts,\nthe <code>contextObject</code> will be the global object, retaining all of its existing\nproperties but also having the built-in objects and functions any standard\n<a href=\"https://es5.github.io/#x15.1\">global object</a> has. Outside of scripts run by the vm module, global variables\nwill remain unchanged.</p>\n<pre><code class=\"language-js\">const vm = require('vm');\n\nglobal.globalVar = 3;\n\nconst context = { globalVar: 1 };\nvm.createContext(context);\n\nvm.runInContext('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=\"vm.html#vm_what_does_it_mean_to_contextify_an_object\">contextified</a> object will be returned.</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)`",
          "type": "method",
          "name": "isContext",
          "meta": {
            "added": [
              "v0.11.7"
            ],
            "changes": []
          },
          "signatures": [
            {
              "return": {
                "textRaw": "Returns: {boolean}",
                "name": "return",
                "type": "boolean"
              },
              "params": [
                {
                  "textRaw": "`object` {Object}",
                  "name": "object",
                  "type": "Object"
                }
              ]
            }
          ],
          "desc": "<p>Returns <code>true</code> if the given <code>oject</code> object has been <a href=\"vm.html#vm_what_does_it_mean_to_contextify_an_object\">contextified</a> using\n<a href=\"vm.html#vm_vm_createcontext_contextobject_options\"><code>vm.createContext()</code></a>.</p>"
        },
        {
          "textRaw": "`vm.runInContext(code, contextifiedObject[, options])`",
          "type": "method",
          "name": "runInContext",
          "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": [
            {
              "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."
              },
              "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 column number offset that is displayed in stack traces produced by this script. **Default:** `0`.",
                      "name": "columnOffset",
                      "type": "number",
                      "default": "`0`",
                      "desc": "Specifies the 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`, the execution will be terminated when `SIGINT` (Ctrl+C) is received. Existing handlers for the event that have been attached via `process.on('SIGINT')` will be disabled during script execution, but will continue to work after that. If execution is terminated, an [`Error`][] will be thrown. **Default:** `false`.",
                      "name": "breakOnSigint",
                      "type": "boolean",
                      "default": "`false`",
                      "desc": "If `true`, the execution will be terminated when `SIGINT` (Ctrl+C) is received. Existing handlers for the event that have been attached via `process.on('SIGINT')` will be disabled during script execution, but will continue to work after that. If execution is terminated, an [`Error`][] will be thrown."
                    },
                    {
                      "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} Called during evaluation of this module when `import()` is called. If this option is not specified, calls to `import()` will reject with [`ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING`][]. This option is part of the experimental modules API, and should not be considered stable.",
                      "name": "importModuleDynamically",
                      "type": "Function",
                      "desc": "Called during evaluation of this module when `import()` is called. If this option is not specified, calls to `import()` will reject with [`ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING`][]. This option is part of the experimental modules API, and should not be considered stable.",
                      "options": [
                        {
                          "textRaw": "`specifier` {string} specifier passed to `import()`",
                          "name": "specifier",
                          "type": "string",
                          "desc": "specifier passed to `import()`"
                        },
                        {
                          "textRaw": "`module` {vm.Module}",
                          "name": "module",
                          "type": "vm.Module"
                        },
                        {
                          "textRaw": "Returns: {Module Namespace Object|vm.Module} Returning a `vm.Module` is recommended in order to take advantage of error tracking, and to avoid issues with namespaces that contain `then` function exports.",
                          "name": "return",
                          "type": "Module Namespace Object|vm.Module",
                          "desc": "Returning a `vm.Module` is recommended in order to take advantage of error tracking, and to avoid issues with namespaces that contain `then` function exports."
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ],
          "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=\"vm.html#vm_what_does_it_mean_to_contextify_an_object\">contextified</a> using the <a href=\"vm.html#vm_vm_createcontext_contextobject_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=\"vm.html#vm_what_does_it_mean_to_contextify_an_object\">contextified</a> object:</p>\n<pre><code class=\"language-js\">const vm = require('vm');\n\nconst contextObject = { globalVar: 1 };\nvm.createContext(contextObject);\n\nfor (let i = 0; i &#x3C; 10; ++i) {\n  vm.runInContext('globalVar *= 2;', contextObject);\n}\nconsole.log(contextObject);\n// Prints: { globalVar: 1024 }\n</code></pre>"
        },
        {
          "textRaw": "`vm.runInNewContext(code[, contextObject[, options]])`",
          "type": "method",
          "name": "runInNewContext",
          "meta": {
            "added": [
              "v0.3.1"
            ],
            "changes": [
              {
                "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": [
            {
              "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."
              },
              "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} An object that will be [contextified][]. If `undefined`, a new object will be created.",
                  "name": "contextObject",
                  "type": "Object",
                  "desc": "An object that will be [contextified][]. If `undefined`, a new object will be created."
                },
                {
                  "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 column number offset that is displayed in stack traces produced by this script. **Default:** `0`.",
                      "name": "columnOffset",
                      "type": "number",
                      "default": "`0`",
                      "desc": "Specifies the 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`, the execution will be terminated when `SIGINT` (Ctrl+C) is received. Existing handlers for the event that have been attached via `process.on('SIGINT')` will be disabled during script execution, but will continue to work after that. If execution is terminated, an [`Error`][] will be thrown. **Default:** `false`.",
                      "name": "breakOnSigint",
                      "type": "boolean",
                      "default": "`false`",
                      "desc": "If `true`, the execution will be terminated when `SIGINT` (Ctrl+C) is received. Existing handlers for the event that have been attached via `process.on('SIGINT')` will be disabled during script execution, but will continue to work after that. If execution is terminated, an [`Error`][] will be thrown."
                    },
                    {
                      "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][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][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. 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} Called during evaluation of this module when `import()` is called. If this option is not specified, calls to `import()` will reject with [`ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING`][]. This option is part of the experimental modules API, and should not be considered stable.",
                      "name": "importModuleDynamically",
                      "type": "Function",
                      "desc": "Called during evaluation of this module when `import()` is called. If this option is not specified, calls to `import()` will reject with [`ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING`][]. This option is part of the experimental modules API, and should not be considered stable.",
                      "options": [
                        {
                          "textRaw": "`specifier` {string} specifier passed to `import()`",
                          "name": "specifier",
                          "type": "string",
                          "desc": "specifier passed to `import()`"
                        },
                        {
                          "textRaw": "`module` {vm.Module}",
                          "name": "module",
                          "type": "vm.Module"
                        },
                        {
                          "textRaw": "Returns: {Module Namespace Object|vm.Module} Returning a `vm.Module` is recommended in order to take advantage of error tracking, and to avoid issues with namespaces that contain `then` function exports.",
                          "name": "return",
                          "type": "Module Namespace Object|vm.Module",
                          "desc": "Returning a `vm.Module` is recommended in order to take advantage of error tracking, and to avoid issues with namespaces that contain `then` function exports."
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ],
          "desc": "<p>The <code>vm.runInNewContext()</code> first contextifies the given <code>contextObject</code> (or\ncreates a new <code>contextObject</code> if passed as <code>undefined</code>), compiles the <code>code</code>,\nruns it within the created context, then returns the result. Running code\ndoes not have access to the local scope.</p>\n<p>If <code>options</code> is a string, then it specifies the filename.</p>\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-js\">const vm = require('vm');\n\nconst contextObject = {\n  animal: 'cat',\n  count: 2\n};\n\nvm.runInNewContext('count += 1; name = \"kitty\"', contextObject);\nconsole.log(contextObject);\n// Prints: { animal: 'cat', count: 3, name: 'kitty' }\n</code></pre>"
        },
        {
          "textRaw": "`vm.runInThisContext(code[, options])`",
          "type": "method",
          "name": "runInThisContext",
          "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": [
            {
              "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."
              },
              "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 column number offset that is displayed in stack traces produced by this script. **Default:** `0`.",
                      "name": "columnOffset",
                      "type": "number",
                      "default": "`0`",
                      "desc": "Specifies the 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`, the execution will be terminated when `SIGINT` (Ctrl+C) is received. Existing handlers for the event that have been attached via `process.on('SIGINT')` will be disabled during script execution, but will continue to work after that. If execution is terminated, an [`Error`][] will be thrown. **Default:** `false`.",
                      "name": "breakOnSigint",
                      "type": "boolean",
                      "default": "`false`",
                      "desc": "If `true`, the execution will be terminated when `SIGINT` (Ctrl+C) is received. Existing handlers for the event that have been attached via `process.on('SIGINT')` will be disabled during script execution, but will continue to work after that. If execution is terminated, an [`Error`][] will be thrown."
                    },
                    {
                      "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} Called during evaluation of this module when `import()` is called. If this option is not specified, calls to `import()` will reject with [`ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING`][]. This option is part of the experimental modules API, and should not be considered stable.",
                      "name": "importModuleDynamically",
                      "type": "Function",
                      "desc": "Called during evaluation of this module when `import()` is called. If this option is not specified, calls to `import()` will reject with [`ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING`][]. This option is part of the experimental modules API, and should not be considered stable.",
                      "options": [
                        {
                          "textRaw": "`specifier` {string} specifier passed to `import()`",
                          "name": "specifier",
                          "type": "string",
                          "desc": "specifier passed to `import()`"
                        },
                        {
                          "textRaw": "`module` {vm.Module}",
                          "name": "module",
                          "type": "vm.Module"
                        },
                        {
                          "textRaw": "Returns: {Module Namespace Object|vm.Module} Returning a `vm.Module` is recommended in order to take advantage of error tracking, and to avoid issues with namespaces that contain `then` function exports.",
                          "name": "return",
                          "type": "Module Namespace Object|vm.Module",
                          "desc": "Returning a `vm.Module` is recommended in order to take advantage of error tracking, and to avoid issues with namespaces that contain `then` function exports."
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ],
          "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<!-- eslint-disable prefer-const -->\n<pre><code class=\"language-js\">const vm = require('vm');\nlet localVar = 'initial value';\n\nconst vmResult = vm.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 href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/eval\"><code>eval()</code></a> <em>does</em> have access to the\nlocal scope, so the value <code>localVar</code> is changed. In this way\n<code>vm.runInThisContext()</code> is much like an <a href=\"https://es5.github.io/#x10.4.2\">indirect <code>eval()</code> call</a>, e.g.\n<code>(0,eval)('code')</code>.</p>\n<h2>Example: Running an HTTP server within a VM</h2>\n<p>When using either <a href=\"vm.html#vm_script_runinthiscontext_options\"><code>script.runInThisContext()</code></a> or\n<a href=\"vm.html#vm_vm_runinthiscontext_code_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>http</code> module the code passed to\nthe context must either call <code>require('http')</code> on its own, or have a reference\nto the <code>http</code> module passed to it. For instance:</p>\n<pre><code class=\"language-js\">'use strict';\nconst vm = require('vm');\n\nconst code = `\n((require) => {\n  const http = require('http');\n\n  http.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\nvm.runInThisContext(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>"
        }
      ],
      "modules": [
        {
          "textRaw": "What does it mean to \"contextify\" an object?",
          "name": "what_does_it_mean_to_\"contextify\"_an_object?",
          "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, the <code>contextObject</code> argument\n(or a newly-created object if <code>contextObject</code> is <code>undefined</code>) is associated\ninternally with a new instance of a V8 Context. This V8 Context provides the\n<code>code</code> run using the <code>vm</code> module's methods with an isolated global environment\nwithin which it can operate. The process of creating the V8 Context and\nassociating it with the <code>contextObject</code> is what this document refers to as\n\"contextifying\" the object.</p>",
          "type": "module",
          "displayName": "What does it mean to \"contextify\" an object?"
        },
        {
          "textRaw": "Timeout limitations when using `process.nextTick()`, promises, and `queueMicrotask()`",
          "name": "timeout_limitations_when_using_`process.nexttick()`,_promises,_and_`queuemicrotask()`",
          "desc": "<p>Because of the internal mechanics of how the <code>process.nextTick()</code> queue and\nthe microtask queue that underlies Promises are implemented within V8 and\nNode.js, it is possible for code running within a context to \"escape\" the\n<code>timeout</code> set using <code>vm.runInContext()</code>, <code>vm.runInNewContext()</code>, and\n<code>vm.runInThisContext()</code>.</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-js\">const vm = require('vm');\n\nfunction loop() {\n  while (1) console.log(Date.now());\n}\n\nvm.runInNewContext(\n  'Promise.resolve().then(loop);',\n  { loop, console },\n  { timeout: 5 }\n);\n</code></pre>\n<p>This issue also occurs when the <code>loop()</code> call is scheduled using\nthe <code>process.nextTick()</code> and <code>queueMicrotask()</code> functions.</p>\n<p>This issue occurs because all contexts share the same microtask and nextTick\nqueues.</p>",
          "type": "module",
          "displayName": "Timeout limitations when using `process.nextTick()`, promises, and `queueMicrotask()`"
        }
      ],
      "type": "module",
      "displayName": "vm"
    },
    {
      "textRaw": "WebAssembly System Interface (WASI)",
      "name": "webassembly_system_interface_(wasi)",
      "introduced_in": "v12.16.0",
      "stability": 1,
      "stabilityText": "Experimental",
      "desc": "<p>The WASI API provides an implementation of the <a href=\"https://wasi.dev/\">WebAssembly System Interface</a>\nspecification. WASI gives sandboxed WebAssembly applications access to the\nunderlying operating system via a collection of POSIX-like functions.</p>\n<pre><code class=\"language-js\">'use strict';\nconst fs = require('fs');\nconst { WASI } = require('wasi');\nconst wasi = new WASI({\n  args: process.argv,\n  env: process.env,\n  preopens: {\n    '/sandbox': '/some/real/path/that/wasm/can/access'\n  }\n});\nconst importObject = { wasi_snapshot_preview1: wasi.wasiImport };\n\n(async () => {\n  const wasm = await WebAssembly.compile(fs.readFileSync('./demo.wasm'));\n  const instance = await WebAssembly.instantiate(wasm, importObject);\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-console\">$ wat2wasm demo.wat\n</code></pre>\n<p>The <code>--experimental-wasi-unstable-preview1</code> and <code>--experimental-wasm-bigint</code>\nCLI arguments are needed for this example to run.</p>",
      "classes": [
        {
          "textRaw": "Class: `WASI`",
          "type": "class",
          "name": "WASI",
          "meta": {
            "added": [
              "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 sandbox environment. For security purposes, each <code>WASI</code>\ninstance must have its command line arguments, environment variables, and\nsandbox directory structure configured explicitly.</p>",
          "methods": [
            {
              "textRaw": "`wasi.start(instance)`",
              "type": "method",
              "name": "start",
              "meta": {
                "added": [
                  "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/Web/JavaScript/Reference/Global_Objects/WebAssembly/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>"
            }
          ],
          "properties": [
            {
              "textRaw": "`wasiImport` {Object}",
              "type": "Object",
              "name": "wasiImport",
              "meta": {
                "added": [
                  "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/Web/JavaScript/Reference/Global_Objects/WebAssembly/Instance\"><code>WebAssembly.Instance</code></a>.</p>"
            }
          ],
          "signatures": [
            {
              "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 sandbox directory structure. The string keys of `preopens` are treated as directories within the sandbox. 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 sandbox directory structure. The string keys of `preopens` are treated as directories within the sandbox. The corresponding values in `preopens` are the real paths to those directories on the host machine."
                    },
                    {
                      "textRaw": "`returnOnExit` {boolean} By default, WASI applications terminate the Node.js process via the `__wasi_proc_exit()` function. Setting this option to `true` causes `wasi.start()` to return the exit code rather than terminate the process. **Default:** `false`.",
                      "name": "returnOnExit",
                      "type": "boolean",
                      "default": "`false`",
                      "desc": "By default, WASI applications terminate the Node.js process via the `__wasi_proc_exit()` function. Setting this option to `true` causes `wasi.start()` to return the exit code rather than terminate the process."
                    },
                    {
                      "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."
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "type": "module",
      "displayName": "WebAssembly System Interface (WASI)"
    },
    {
      "textRaw": "Worker threads",
      "name": "worker_threads",
      "introduced_in": "v10.5.0",
      "stability": 2,
      "stabilityText": "Stable",
      "desc": "<p>The <code>worker_threads</code> module enables the use of threads that execute JavaScript\nin parallel. To access it:</p>\n<pre><code class=\"language-js\">const worker = require('worker_threads');\n</code></pre>\n<p>Workers (threads) are useful for performing CPU-intensive JavaScript operations.\nThey will not help much with I/O-intensive work. Node.js’s built-in asynchronous\nI/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-js\">const {\n  Worker, isMainThread, parentPort, workerData\n} = require('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.on('error', reject);\n      worker.on('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>parse()</code> call. In actual\npractice, use a pool of Workers instead 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#async_hooks_class_asyncresource\"><code>AsyncResource</code></a> API to inform\ndiagnostic tools (e.g. in order to provide asynchronous stack traces) about the\ncorrelation between tasks and their outcomes. See\n<a href=\"async_hooks.html#async-resource-worker-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=\"worker_threads.html#worker_threads_new_worker_filename_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>",
      "properties": [
        {
          "textRaw": "`isMainThread` {boolean}",
          "type": "boolean",
          "name": "isMainThread",
          "meta": {
            "added": [
              "v10.5.0"
            ],
            "changes": []
          },
          "desc": "<p>Is <code>true</code> if this code is not running inside of a <a href=\"worker_threads.html#worker_threads_class_worker\"><code>Worker</code></a> thread.</p>\n<pre><code class=\"language-js\">const { Worker, isMainThread } = require('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": "`parentPort` {null|MessagePort}",
          "type": "null|MessagePort",
          "name": "parentPort",
          "meta": {
            "added": [
              "v10.5.0"
            ],
            "changes": []
          },
          "desc": "<p>If this thread was spawned as a <a href=\"worker_threads.html#worker_threads_class_worker\"><code>Worker</code></a>, this will be a <a href=\"worker_threads.html#worker_threads_class_messageport\"><code>MessagePort</code></a>\nallowing communication with the parent thread. Messages sent using\n<code>parentPort.postMessage()</code> will be available in the parent thread\nusing <code>worker.on('message')</code>, and messages sent from the parent thread\nusing <code>worker.postMessage()</code> will be available in this thread using\n<code>parentPort.on('message')</code>.</p>\n<pre><code class=\"language-js\">const { Worker, isMainThread, parentPort } = require('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": "`resourceLimits` {Object}",
          "type": "Object",
          "name": "resourceLimits",
          "meta": {
            "added": [
              "v12.16.0"
            ],
            "changes": []
          },
          "options": [
            {
              "textRaw": "`maxYoungGenerationSizeMb` {number}",
              "name": "maxYoungGenerationSizeMb",
              "type": "number"
            },
            {
              "textRaw": "`maxOldGenerationSizeMb` {number}",
              "name": "maxOldGenerationSizeMb",
              "type": "number"
            },
            {
              "textRaw": "`codeRangeSizeMb` {number}",
              "name": "codeRangeSizeMb",
              "type": "number"
            }
          ],
          "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=\"worker_threads.html#worker_threads_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>"
        },
        {
          "textRaw": "`SHARE_ENV` {symbol}",
          "type": "symbol",
          "name": "SHARE_ENV",
          "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=\"worker_threads.html#worker_threads_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-js\">const { Worker, SHARE_ENV } = require('worker_threads');\nnew Worker('process.env.SET_IN_WORKER = \"foo\"', { eval: true, env: SHARE_ENV })\n  .on('exit', () => {\n    console.log(process.env.SET_IN_WORKER);  // Prints 'foo'.\n  });\n</code></pre>"
        },
        {
          "textRaw": "`threadId` {integer}",
          "type": "integer",
          "name": "threadId",
          "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=\"worker_threads.html#worker_threads_worker_threadid_1\"><code>worker.threadId</code></a>.\nThis value is unique for each <a href=\"worker_threads.html#worker_threads_class_worker\"><code>Worker</code></a> instance inside a single process.</p>"
        },
        {
          "textRaw": "`worker.workerData`",
          "name": "workerData",
          "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=\"worker_threads.html#worker_threads_port_postmessage_value_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-js\">const { Worker, isMainThread, workerData } = require('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>"
        }
      ],
      "methods": [
        {
          "textRaw": "`worker.moveMessagePortToContext(port, contextifiedSandbox)`",
          "type": "method",
          "name": "moveMessagePortToContext",
          "meta": {
            "added": [
              "v11.13.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "return": {
                "textRaw": "Returns: {MessagePort}",
                "name": "return",
                "type": "MessagePort"
              },
              "params": [
                {
                  "textRaw": "`port` {MessagePort} The message port which will be transferred.",
                  "name": "port",
                  "type": "MessagePort",
                  "desc": "The message port which will be transferred."
                },
                {
                  "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."
                }
              ]
            }
          ],
          "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 will be rendered unusable, and the returned <code>MessagePort</code> instance will\ntake its place.</p>\n<p>The returned <code>MessagePort</code> will be an object in the target context, and will\ninherit from its global <code>Object</code> class. Objects passed to the\n<a href=\"https://developer.mozilla.org/en-US/docs/Web/API/MessagePort/onmessage\"><code>port.onmessage()</code></a> listener will also be created in the target context\nand inherit from its global <code>Object</code> class.</p>\n<p>However, the created <code>MessagePort</code> will no longer inherit from\n<a href=\"events.html\"><code>EventEmitter</code></a>, and only <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/MessagePort/onmessage\"><code>port.onmessage()</code></a> can be used to receive\nevents using it.</p>"
        },
        {
          "textRaw": "`worker.receiveMessageOnPort(port)`",
          "type": "method",
          "name": "receiveMessageOnPort",
          "meta": {
            "added": [
              "v12.3.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "return": {
                "textRaw": "Returns: {Object|undefined}",
                "name": "return",
                "type": "Object|undefined"
              },
              "params": [
                {
                  "textRaw": "`port` {MessagePort}",
                  "name": "port",
                  "type": "MessagePort"
                }
              ]
            }
          ],
          "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-js\">const { MessageChannel, receiveMessageOnPort } = require('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 will be emitted and the\n<code>onmessage</code> listener will not be invoked.</p>"
        }
      ],
      "classes": [
        {
          "textRaw": "Class: `MessageChannel`",
          "type": "class",
          "name": "MessageChannel",
          "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=\"worker_threads.html#worker_threads_class_messageport\"><code>MessagePort</code></a> instances.</p>\n<pre><code class=\"language-js\">const { MessageChannel } = require('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`",
          "type": "class",
          "name": "MessagePort",
          "meta": {
            "added": [
              "v10.5.0"
            ],
            "changes": []
          },
          "desc": "<ul>\n<li>Extends: <a href=\"events.html#events_class_eventemitter\" class=\"type\">&lt;EventEmitter&gt;</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=\"worker_threads.html#worker_threads_class_worker\"><code>Worker</code></a>s.</p>\n<p>With the exception of <code>MessagePort</code>s being <a href=\"events.html\"><code>EventEmitter</code></a>s rather\nthan <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/EventTarget\"><code>EventTarget</code></a>s, 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'`",
              "type": "event",
              "name": "close",
              "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-js\">const { MessageChannel } = require('worker_threads');\nconst { port1, port2 } = new MessageChannel();\n\n// Prints:\n//   foobar\n//   closed!\nport2.on('message', (message) => console.log(message));\nport2.on('close', () => console.log('closed!'));\n\nport1.postMessage('foobar');\nport1.close();\n</code></pre>"
            },
            {
              "textRaw": "Event: `'message'`",
              "type": "event",
              "name": "message",
              "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=\"worker_threads.html#worker_threads_port_postmessage_value_transferlist\"><code>port.postMessage()</code></a>.</p>\n<p>Listeners on this event will receive a clone of the <code>value</code> parameter as passed\nto <code>postMessage()</code> and no further arguments.</p>"
            }
          ],
          "methods": [
            {
              "textRaw": "`port.close()`",
              "type": "method",
              "name": "close",
              "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=\"worker_threads.html#worker_threads_event_close\"><code>'close'</code> event</a> will be emitted on both <code>MessagePort</code> instances that\nare part of the channel.</p>"
            },
            {
              "textRaw": "`port.postMessage(value[, transferList])`",
              "type": "method",
              "name": "postMessage",
              "meta": {
                "added": [
                  "v10.5.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`value` {any}",
                      "name": "value",
                      "type": "any"
                    },
                    {
                      "textRaw": "`transferList` {Object[]}",
                      "name": "transferList",
                      "type": "Object[]"
                    }
                  ]
                }
              ],
              "desc": "<p>Sends a JavaScript value to the receiving side of this channel.\n<code>value</code> will be 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/Web/JavaScript/Reference/Global_Objects/WebAssembly/Module\"><code>WebAssembly.Module</code></a> instances.</li>\n<li><code>value</code> may not contain native (C++-backed) objects other than <code>MessagePort</code>s.</li>\n</ul>\n<pre><code class=\"language-js\">const { MessageChannel } = require('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 <code>ArrayBuffer</code> and <code>MessagePort</code> objects.\nAfter transferring, they will not be 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/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer\"><code>SharedArrayBuffer</code></a> instances, those will be 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-js\">const { MessageChannel } = require('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` will be 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>Because the object cloning uses the structured clone algorithm,\nnon-enumerable properties, property accessors, and object prototypes are\nnot preserved. In particular, <a href=\"buffer.html\"><code>Buffer</code></a> objects will be read as\nplain <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array\"><code>Uint8Array</code></a>s on the receiving side.</p>\n<p>The message object will be 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#v8_serialization_api\">serialization API of the <code>v8</code> module</a>.</p>",
              "modules": [
                {
                  "textRaw": "Considerations when transferring TypedArrays and Buffers",
                  "name": "considerations_when_transferring_typedarrays_and_buffers",
                  "desc": "<p>All <code>TypedArray</code> and <code>Buffer</code> instances are views over an underlying\n<code>ArrayBuffer</code>. 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 will cause 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>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.alloc()</code>),\ntransferring them is not possible and they will always be 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#buffer_class_method_buffer_allocunsafe_size\"><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 will render all other existing views of\nthose <code>ArrayBuffer</code>s unusable.</p>",
                  "type": "module",
                  "displayName": "Considerations when transferring TypedArrays and Buffers"
                }
              ]
            },
            {
              "textRaw": "`port.ref()`",
              "type": "method",
              "name": "ref",
              "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 will\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 will have no effect.</p>\n<p>If listeners are attached or removed using <code>.on('message')</code>, the port will\nbe <code>ref()</code>ed and <code>unref()</code>ed automatically depending on whether\nlisteners for the event exist.</p>"
            },
            {
              "textRaw": "`port.start()`",
              "type": "method",
              "name": "start",
              "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 will be 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 will\nautomatically call <code>.start()</code>, but unsetting it will let messages queue up\nuntil a new handler is set or the port is discarded.</p>"
            },
            {
              "textRaw": "`port.unref()`",
              "type": "method",
              "name": "unref",
              "meta": {
                "added": [
                  "v10.5.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Calling <code>unref()</code> on a port will allow 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 will have no effect.</p>\n<p>If listeners are attached or removed using <code>.on('message')</code>, the port will\nbe <code>ref()</code>ed and <code>unref()</code>ed automatically depending on whether\nlisteners for the event exist.</p>"
            }
          ]
        },
        {
          "textRaw": "Class: `Worker`",
          "type": "class",
          "name": "Worker",
          "meta": {
            "added": [
              "v10.5.0"
            ],
            "changes": []
          },
          "desc": "<ul>\n<li>Extends: <a href=\"events.html#events_class_eventemitter\" class=\"type\">&lt;EventEmitter&gt;</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#process_process_stdin\"><code>process.stdin</code></a>, <a href=\"process.html#process_process_stdout\"><code>process.stdout</code></a> and <a href=\"process.html#process_process_stderr\"><code>process.stderr</code></a>\nmay be redirected by the parent thread.</li>\n<li>The <a href=\"worker_threads.html#worker_threads_worker_ismainthread\"><code>require('worker_threads').isMainThread</code></a> property is set to <code>false</code>.</li>\n<li>The <a href=\"worker_threads.html#worker_threads_worker_parentport\"><code>require('worker_threads').parentPort</code></a> message port is available.</li>\n<li><a href=\"process.html#process_process_exit_code\"><code>process.exit()</code></a> does not stop the whole program, just the single thread,\nand <a href=\"process.html#process_process_abort\"><code>process.abort()</code></a> is not available.</li>\n<li><a href=\"process.html#process_process_chdir_directory\"><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#process_process_env\"><code>process.env</code></a> is a copy of the parent thread's environment variables,\nunless otherwise specified. Changes to one copy will not be visible in other\nthreads, and will not be visible to native add-ons (unless\n<a href=\"worker_threads.html#worker_threads_worker_share_env\"><code>worker.SHARE_ENV</code></a> has been passed as the <code>env</code> option to the\n<a href=\"worker_threads.html#worker_threads_class_worker\"><code>Worker</code></a> constructor).</li>\n<li><a href=\"process.html#process_process_title\"><code>process.title</code></a> cannot be modified.</li>\n<li>Signals will not be delivered through <a href=\"process.html#process_signal_events\"><code>process.on('...')</code></a>.</li>\n<li>Execution may stop at any point as a result of <a href=\"worker_threads.html#worker_threads_worker_terminate\"><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#addons_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>cluster</code> module</a>, two-way communication can be\nachieved through inter-thread message passing. Internally, a <code>Worker</code> has a\nbuilt-in pair of <a href=\"worker_threads.html#worker_threads_class_messageport\"><code>MessagePort</code></a>s that are already associated with each other\nwhen the <code>Worker</code> is created. While the <code>MessagePort</code> object on the parent side\nis not directly exposed, its functionalities are exposed through\n<a href=\"worker_threads.html#worker_threads_worker_postmessage_value_transferlist\"><code>worker.postMessage()</code></a> and the <a href=\"worker_threads.html#worker_threads_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=\"worker_threads.html#worker_threads_port_postmessage_value_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-js\">const assert = require('assert');\nconst {\n  Worker, MessageChannel, MessagePort, isMainThread, parentPort\n} = require('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>",
          "events": [
            {
              "textRaw": "Event: `'error'`",
              "type": "event",
              "name": "error",
              "meta": {
                "added": [
                  "v10.5.0"
                ],
                "changes": []
              },
              "params": [
                {
                  "textRaw": "`err` {Error}",
                  "name": "err",
                  "type": "Error"
                }
              ],
              "desc": "<p>The <code>'error'</code> event is emitted if the worker thread throws an uncaught\nexception. In that case, the worker will be terminated.</p>"
            },
            {
              "textRaw": "Event: `'exit'`",
              "type": "event",
              "name": "exit",
              "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#process_process_exit_code\"><code>process.exit()</code></a>, the <code>exitCode</code> parameter will be the\npassed exit code. If the worker was terminated, the <code>exitCode</code> parameter will\nbe <code>1</code>.</p>\n<p>This is the final event emitted by any <code>Worker</code> instance.</p>"
            },
            {
              "textRaw": "Event: `'message'`",
              "type": "event",
              "name": "message",
              "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=\"worker_threads.html#worker_threads_worker_postmessage_value_transferlist\"><code>require('worker_threads').parentPort.postMessage()</code></a>.\nSee the <a href=\"worker_threads.html#worker_threads_event_message\"><code>port.on('message')</code></a> event for more details.</p>\n<p>All messages sent from the worker thread will be emitted before the\n<a href=\"worker_threads.html#worker_threads_event_exit\"><code>'exit'</code> event</a> is emitted on the <code>Worker</code> object.</p>"
            },
            {
              "textRaw": "Event: `'online'`",
              "type": "event",
              "name": "online",
              "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.getHeapSnapshot()`",
              "type": "method",
              "name": "getHeapSnapshot",
              "meta": {
                "added": [
                  "v12.17.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "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"
                  },
                  "params": []
                }
              ],
              "desc": "<p>Returns a readable stream for a V8 snapshot of the current state of the Worker.\nSee <a href=\"v8.html#v8_v8_getheapsnapshot\"><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=\"worker_threads.html#worker_threads_event_exit\"><code>'exit'</code> event</a> is emitted, the returned <code>Promise</code> will be rejected\nimmediately with an <a href=\"errors.html#ERR_WORKER_NOT_RUNNING\"><code>ERR_WORKER_NOT_RUNNING</code></a> error.</p>"
            },
            {
              "textRaw": "`worker.postMessage(value[, transferList])`",
              "type": "method",
              "name": "postMessage",
              "meta": {
                "added": [
                  "v10.5.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`value` {any}",
                      "name": "value",
                      "type": "any"
                    },
                    {
                      "textRaw": "`transferList` {Object[]}",
                      "name": "transferList",
                      "type": "Object[]"
                    }
                  ]
                }
              ],
              "desc": "<p>Send a message to the worker that will be received via\n<a href=\"worker_threads.html#worker_threads_event_message\"><code>require('worker_threads').parentPort.on('message')</code></a>.\nSee <a href=\"worker_threads.html#worker_threads_port_postmessage_value_transferlist\"><code>port.postMessage()</code></a> for more details.</p>"
            },
            {
              "textRaw": "`worker.ref()`",
              "type": "method",
              "name": "ref",
              "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 will\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 will have\nno effect.</p>"
            },
            {
              "textRaw": "`worker.terminate()`",
              "type": "method",
              "name": "terminate",
              "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": [
                {
                  "return": {
                    "textRaw": "Returns: {Promise}",
                    "name": "return",
                    "type": "Promise"
                  },
                  "params": []
                }
              ],
              "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=\"worker_threads.html#worker_threads_event_exit\"><code>'exit'</code> event</a> is emitted.</p>"
            },
            {
              "textRaw": "`worker.unref()`",
              "type": "method",
              "name": "unref",
              "meta": {
                "added": [
                  "v10.5.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Calling <code>unref()</code> on a worker will allow 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 will have no effect.</p>"
            }
          ],
          "properties": [
            {
              "textRaw": "`resourceLimits` {Object}",
              "type": "Object",
              "name": "resourceLimits",
              "meta": {
                "added": [
                  "v12.16.0"
                ],
                "changes": []
              },
              "options": [
                {
                  "textRaw": "`maxYoungGenerationSizeMb` {number}",
                  "name": "maxYoungGenerationSizeMb",
                  "type": "number"
                },
                {
                  "textRaw": "`maxOldGenerationSizeMb` {number}",
                  "name": "maxOldGenerationSizeMb",
                  "type": "number"
                },
                {
                  "textRaw": "`codeRangeSizeMb` {number}",
                  "name": "codeRangeSizeMb",
                  "type": "number"
                }
              ],
              "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=\"worker_threads.html#worker_threads_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>"
            },
            {
              "textRaw": "`stderr` {stream.Readable}",
              "type": "stream.Readable",
              "name": "stderr",
              "meta": {
                "added": [
                  "v10.5.0"
                ],
                "changes": []
              },
              "desc": "<p>This is a readable stream which contains data written to <a href=\"process.html#process_process_stderr\"><code>process.stderr</code></a>\ninside the worker thread. If <code>stderr: true</code> was not passed to the\n<a href=\"worker_threads.html#worker_threads_class_worker\"><code>Worker</code></a> constructor, then data will be piped to the parent thread's\n<a href=\"process.html#process_process_stderr\"><code>process.stderr</code></a> stream.</p>"
            },
            {
              "textRaw": "`stdin` {null|stream.Writable}",
              "type": "null|stream.Writable",
              "name": "stdin",
              "meta": {
                "added": [
                  "v10.5.0"
                ],
                "changes": []
              },
              "desc": "<p>If <code>stdin: true</code> was passed to the <a href=\"worker_threads.html#worker_threads_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#process_process_stdin\"><code>process.stdin</code></a>.</p>"
            },
            {
              "textRaw": "`stdout` {stream.Readable}",
              "type": "stream.Readable",
              "name": "stdout",
              "meta": {
                "added": [
                  "v10.5.0"
                ],
                "changes": []
              },
              "desc": "<p>This is a readable stream which contains data written to <a href=\"process.html#process_process_stdout\"><code>process.stdout</code></a>\ninside the worker thread. If <code>stdout: true</code> was not passed to the\n<a href=\"worker_threads.html#worker_threads_class_worker\"><code>Worker</code></a> constructor, then data will be piped to the parent thread's\n<a href=\"process.html#process_process_stdout\"><code>process.stdout</code></a> stream.</p>"
            },
            {
              "textRaw": "`threadId` {integer}",
              "type": "integer",
              "name": "threadId",
              "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_threads.html#worker_threads_worker_threadid\"><code>require('worker_threads').threadId</code></a>.\nThis value is unique for each <code>Worker</code> instance inside a single process.</p>"
            }
          ],
          "signatures": [
            {
              "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:` protocol. 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:` protocol. 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 will be 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 will be 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 will 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 will 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 will be provided as [`process.execArgv`][] inside the worker. By default, options will be 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 will be provided as [`process.execArgv`][] inside the worker. By default, options will be inherited from the parent thread."
                    },
                    {
                      "textRaw": "`stdin` {boolean} If this is set to `true`, then `worker.stdin` will provide a writable stream whose contents will 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` will provide a writable stream whose contents will 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` will not automatically be piped through to `process.stdout` in the parent.",
                      "name": "stdout",
                      "type": "boolean",
                      "desc": "If this is set to `true`, then `worker.stdout` will not automatically be piped through to `process.stdout` in the parent."
                    },
                    {
                      "textRaw": "`stderr` {boolean} If this is set to `true`, then `worker.stderr` will not automatically be piped through to `process.stderr` in the parent.",
                      "name": "stderr",
                      "type": "boolean",
                      "desc": "If this is set to `true`, then `worker.stderr` will not automatically be piped through to `process.stderr` in the parent."
                    },
                    {
                      "textRaw": "`workerData` {any} Any JavaScript value that will be cloned and made available as [`require('worker_threads').workerData`][]. The cloning will occur as described in the [HTML structured clone algorithm][], and an error will be thrown if the object cannot be cloned (e.g. because it contains `function`s).",
                      "name": "workerData",
                      "type": "any",
                      "desc": "Any JavaScript value that will be cloned and made available as [`require('worker_threads').workerData`][]. The cloning will occur as described in the [HTML structured clone algorithm][], and an error will be thrown if the object cannot be cloned (e.g. because it contains `function`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`][] will be 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`][] will be 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 will lead 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 will lead 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.",
                          "name": "maxOldGenerationSizeMb",
                          "type": "number",
                          "desc": "The maximum size of the main heap in MB."
                        },
                        {
                          "textRaw": "`maxYoungGenerationSizeMb` {number} The maximum size of a heap space for recently created objects.",
                          "name": "maxYoungGenerationSizeMb",
                          "type": "number",
                          "desc": "The maximum size of a heap space for recently created objects."
                        },
                        {
                          "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."
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "type": "module",
      "displayName": "Worker threads"
    },
    {
      "textRaw": "Zlib",
      "name": "zlib",
      "introduced_in": "v0.10.0",
      "stability": 2,
      "stabilityText": "Stable",
      "desc": "<p>The <code>zlib</code> module provides compression functionality implemented using Gzip,\nDeflate/Inflate, and Brotli.</p>\n<p>To access it:</p>\n<pre><code class=\"language-js\">const zlib = require('zlib');\n</code></pre>\n<p>Compression and decompression are built around the Node.js <a href=\"stream.md\">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-js\">const { createGzip } = require('zlib');\nconst { pipeline } = require('stream');\nconst {\n  createReadStream,\n  createWriteStream\n} = require('fs');\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\n// Or, Promisified\n\nconst { promisify } = require('util');\nconst pipe = promisify(pipeline);\n\nasync function do_gzip(input, output) {\n  const gzip = createGzip();\n  const source = createReadStream(input);\n  const destination = createWriteStream(output);\n  await pipe(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-js\">const { deflate, unzip } = require('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('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",
          "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-js\">const zlib = require('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 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>",
          "type": "module",
          "displayName": "Threadpool usage and performance considerations"
        },
        {
          "textRaw": "Compressing HTTP requests and responses",
          "name": "compressing_http_requests_and_responses",
          "desc": "<p>The <code>zlib</code> module can be used to implement support for the <code>gzip</code>, <code>deflate</code>\nand <code>br</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=\"zlib.html#zlib_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-js\">// Client request example\nconst zlib = require('zlib');\nconst http = require('http');\nconst fs = require('fs');\nconst { pipeline } = require('stream');\n\nconst request = http.get({ host: 'example.com',\n                           path: '/',\n                           port: 80,\n                           headers: { 'Accept-Encoding': 'br,gzip,deflate' } });\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    default:\n      pipeline(response, output, onError);\n      break;\n  }\n});\n</code></pre>\n<pre><code class=\"language-js\">// 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('zlib');\nconst http = require('http');\nconst fs = require('fs');\nconst { pipeline } = require('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  let acceptEncoding = request.headers['accept-encoding'];\n  if (!acceptEncoding) {\n    acceptEncoding = '';\n  }\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 {\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  { 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>",
          "type": "module",
          "displayName": "Compressing HTTP requests and responses"
        },
        {
          "textRaw": "Flushing",
          "name": "flushing",
          "desc": "<p>Calling <a href=\"zlib.html#zlib_zlib_flush_kind_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-js\">const zlib = require('zlib');\nconst http = require('http');\nconst { pipeline } = require('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>",
          "type": "module",
          "displayName": "Flushing"
        }
      ],
      "miscs": [
        {
          "textRaw": "Memory usage tuning",
          "name": "Memory usage tuning",
          "type": "misc",
          "miscs": [
            {
              "textRaw": "For zlib-based streams",
              "name": "for_zlib-based_streams",
              "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<!-- eslint-disable semi -->\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>",
              "type": "misc",
              "displayName": "For zlib-based streams"
            },
            {
              "textRaw": "For Brotli-based streams",
              "name": "for_brotli-based_streams",
              "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=\"zlib.html#zlib_brotli_constants\">below</a> for more details on Brotli-specific options.</p>",
              "type": "misc",
              "displayName": "For Brotli-based streams"
            }
          ]
        },
        {
          "textRaw": "Constants",
          "name": "Constants",
          "meta": {
            "added": [
              "v0.5.8"
            ],
            "changes": []
          },
          "type": "misc",
          "miscs": [
            {
              "textRaw": "zlib constants",
              "name": "zlib_constants",
              "desc": "<p>All of the constants defined in <code>zlib.h</code> are also defined on\n<code>require('zlib').constants</code>. In the normal course of operations, it will not be\nnecessary to use these constants. They are documented so that their presence is\nnot 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('zlib')</code>, for\ninstance <code>zlib.Z_NO_FLUSH</code>. Accessing the constants directly from the module is\ncurrently 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<li><code>zlib.constants.Z_TREES</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>",
              "type": "misc",
              "displayName": "zlib constants"
            },
            {
              "textRaw": "Brotli constants",
              "name": "brotli_constants",
              "meta": {
                "added": [
                  "v11.7.0"
                ],
                "changes": []
              },
              "desc": "<p>There are several options and other constants available for Brotli-based\nstreams:</p>",
              "modules": [
                {
                  "textRaw": "Flush operations",
                  "name": "flush_operations",
                  "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>\n<p><code>zlib.constants.BROTLI_OPERATION_EMIT_METADATA</code></p>\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>",
                  "type": "module",
                  "displayName": "Flush operations"
                },
                {
                  "textRaw": "Compressor options",
                  "name": "compressor_options",
                  "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>\n<p><code>BROTLI_PARAM_MODE</code></p>\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>\n<p><code>BROTLI_PARAM_QUALITY</code></p>\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>\n<p><code>BROTLI_PARAM_SIZE_HINT</code></p>\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>\n<p><code>BROTLI_PARAM_LGWIN</code></p>\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>\n<p><code>BROTLI_PARAM_LGBLOCK</code></p>\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>\n<p><code>BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING</code></p>\n<ul>\n<li>Boolean flag that decreases compression ratio in favour of\ndecompression speed.</li>\n</ul>\n</li>\n<li>\n<p><code>BROTLI_PARAM_LARGE_WINDOW</code></p>\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.txt\">RFC 7932</a>).</li>\n</ul>\n</li>\n<li>\n<p><code>BROTLI_PARAM_NPOSTFIX</code></p>\n<ul>\n<li>Ranges from <code>0</code> to <code>BROTLI_MAX_NPOSTFIX</code>.</li>\n</ul>\n</li>\n<li>\n<p><code>BROTLI_PARAM_NDIRECT</code></p>\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>",
                  "type": "module",
                  "displayName": "Compressor options"
                },
                {
                  "textRaw": "Decompressor options",
                  "name": "decompressor_options",
                  "desc": "<p>These advanced options are available for controlling decompression:</p>\n<ul>\n<li>\n<p><code>BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION</code></p>\n<ul>\n<li>Boolean flag that affects internal memory allocation patterns.</li>\n</ul>\n</li>\n<li>\n<p><code>BROTLI_DECODER_PARAM_LARGE_WINDOW</code></p>\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.txt\">RFC 7932</a>).</li>\n</ul>\n</li>\n</ul>",
                  "type": "module",
                  "displayName": "Decompressor options"
                }
              ],
              "type": "misc",
              "displayName": "Brotli constants"
            }
          ]
        },
        {
          "textRaw": "Class: `Options`",
          "type": "misc",
          "name": "Options",
          "meta": {
            "added": [
              "v0.11.1"
            ],
            "changes": [
              {
                "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/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;integer&gt;</a> <strong>Default:</strong> <code>zlib.constants.Z_NO_FLUSH</code></li>\n<li><code>finishFlush</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;integer&gt;</a> <strong>Default:</strong> <code>zlib.constants.Z_FINISH</code></li>\n<li><code>chunkSize</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;integer&gt;</a> <strong>Default:</strong> <code>16 * 1024</code></li>\n<li><code>windowBits</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;integer&gt;</a></li>\n<li><code>level</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;integer&gt;</a> (compression only)</li>\n<li><code>memLevel</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;integer&gt;</a> (compression only)</li>\n<li><code>strategy</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;integer&gt;</a> (compression only)</li>\n<li><code>dictionary</code> <a href=\"buffer.html#buffer_class_buffer\" class=\"type\">&lt;Buffer&gt;</a> | <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray\" class=\"type\">&lt;TypedArray&gt;</a> | <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView\" class=\"type\">&lt;DataView&gt;</a> | <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer\" class=\"type\">&lt;ArrayBuffer&gt;</a> (deflate/inflate only,\nempty dictionary by default)</li>\n<li><code>info</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type\" class=\"type\">&lt;boolean&gt;</a> (If <code>true</code>, returns an object with <code>buffer</code> and <code>engine</code>.)</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`",
          "type": "misc",
          "name": "BrotliOptions",
          "meta": {
            "added": [
              "v11.7.0"
            ],
            "changes": []
          },
          "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/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;integer&gt;</a> <strong>Default:</strong> <code>zlib.constants.BROTLI_OPERATION_PROCESS</code></li>\n<li><code>finishFlush</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;integer&gt;</a> <strong>Default:</strong> <code>zlib.constants.BROTLI_OPERATION_FINISH</code></li>\n<li><code>chunkSize</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;integer&gt;</a> <strong>Default:</strong> <code>16 * 1024</code></li>\n<li><code>params</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object\" class=\"type\">&lt;Object&gt;</a> Key-value object containing indexed <a href=\"zlib.html#zlib_brotli_constants\">Brotli parameters</a>.</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": "Convenience methods",
          "name": "Convenience methods",
          "type": "misc",
          "desc": "<p>All of these take a <a href=\"buffer.html#buffer_class_buffer\"><code>Buffer</code></a>, <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray\"><code>TypedArray</code></a>, <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView\"><code>DataView</code></a>,\n<a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer\"><code>ArrayBuffer</code></a> or string as 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)`",
              "type": "method",
              "name": "brotliCompress",
              "meta": {
                "added": [
                  "v11.7.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"
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function"
                    }
                  ]
                }
              ]
            },
            {
              "textRaw": "`zlib.brotliCompressSync(buffer[, options])`",
              "type": "method",
              "name": "brotliCompressSync",
              "meta": {
                "added": [
                  "v11.7.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"
                    }
                  ]
                }
              ],
              "desc": "<p>Compress a chunk of data with <a href=\"zlib.html#zlib_class_zlib_brotlicompress\"><code>BrotliCompress</code></a>.</p>"
            },
            {
              "textRaw": "`zlib.brotliDecompress(buffer[, options], callback)`",
              "type": "method",
              "name": "brotliDecompress",
              "meta": {
                "added": [
                  "v11.7.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"
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function"
                    }
                  ]
                }
              ]
            },
            {
              "textRaw": "`zlib.brotliDecompressSync(buffer[, options])`",
              "type": "method",
              "name": "brotliDecompressSync",
              "meta": {
                "added": [
                  "v11.7.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"
                    }
                  ]
                }
              ],
              "desc": "<p>Decompress a chunk of data with <a href=\"zlib.html#zlib_class_zlib_brotlidecompress\"><code>BrotliDecompress</code></a>.</p>"
            },
            {
              "textRaw": "`zlib.deflate(buffer[, options], callback)`",
              "type": "method",
              "name": "deflate",
              "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"
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function"
                    }
                  ]
                }
              ]
            },
            {
              "textRaw": "`zlib.deflateSync(buffer[, options])`",
              "type": "method",
              "name": "deflateSync",
              "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"
                    }
                  ]
                }
              ],
              "desc": "<p>Compress a chunk of data with <a href=\"zlib.html#zlib_class_zlib_deflate\"><code>Deflate</code></a>.</p>"
            },
            {
              "textRaw": "`zlib.deflateRaw(buffer[, options], callback)`",
              "type": "method",
              "name": "deflateRaw",
              "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"
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function"
                    }
                  ]
                }
              ]
            },
            {
              "textRaw": "`zlib.deflateRawSync(buffer[, options])`",
              "type": "method",
              "name": "deflateRawSync",
              "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"
                    }
                  ]
                }
              ],
              "desc": "<p>Compress a chunk of data with <a href=\"zlib.html#zlib_class_zlib_deflateraw\"><code>DeflateRaw</code></a>.</p>"
            },
            {
              "textRaw": "`zlib.gunzip(buffer[, options], callback)`",
              "type": "method",
              "name": "gunzip",
              "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"
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function"
                    }
                  ]
                }
              ]
            },
            {
              "textRaw": "`zlib.gunzipSync(buffer[, options])`",
              "type": "method",
              "name": "gunzipSync",
              "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"
                    }
                  ]
                }
              ],
              "desc": "<p>Decompress a chunk of data with <a href=\"zlib.html#zlib_class_zlib_gunzip\"><code>Gunzip</code></a>.</p>"
            },
            {
              "textRaw": "`zlib.gzip(buffer[, options], callback)`",
              "type": "method",
              "name": "gzip",
              "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"
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function"
                    }
                  ]
                }
              ]
            },
            {
              "textRaw": "`zlib.gzipSync(buffer[, options])`",
              "type": "method",
              "name": "gzipSync",
              "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"
                    }
                  ]
                }
              ],
              "desc": "<p>Compress a chunk of data with <a href=\"zlib.html#zlib_class_zlib_gzip\"><code>Gzip</code></a>.</p>"
            },
            {
              "textRaw": "`zlib.inflate(buffer[, options], callback)`",
              "type": "method",
              "name": "inflate",
              "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"
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function"
                    }
                  ]
                }
              ]
            },
            {
              "textRaw": "`zlib.inflateSync(buffer[, options])`",
              "type": "method",
              "name": "inflateSync",
              "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"
                    }
                  ]
                }
              ],
              "desc": "<p>Decompress a chunk of data with <a href=\"zlib.html#zlib_class_zlib_inflate\"><code>Inflate</code></a>.</p>"
            },
            {
              "textRaw": "`zlib.inflateRaw(buffer[, options], callback)`",
              "type": "method",
              "name": "inflateRaw",
              "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"
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function"
                    }
                  ]
                }
              ]
            },
            {
              "textRaw": "`zlib.inflateRawSync(buffer[, options])`",
              "type": "method",
              "name": "inflateRawSync",
              "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"
                    }
                  ]
                }
              ],
              "desc": "<p>Decompress a chunk of data with <a href=\"zlib.html#zlib_class_zlib_inflateraw\"><code>InflateRaw</code></a>.</p>"
            },
            {
              "textRaw": "`zlib.unzip(buffer[, options], callback)`",
              "type": "method",
              "name": "unzip",
              "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"
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function"
                    }
                  ]
                }
              ]
            },
            {
              "textRaw": "`zlib.unzipSync(buffer[, options])`",
              "type": "method",
              "name": "unzipSync",
              "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"
                    }
                  ]
                }
              ],
              "desc": "<p>Decompress a chunk of data with <a href=\"zlib.html#zlib_class_zlib_unzip\"><code>Unzip</code></a>.</p>"
            }
          ]
        }
      ],
      "meta": {
        "added": [
          "v0.5.8"
        ],
        "changes": []
      },
      "classes": [
        {
          "textRaw": "Class: `zlib.BrotliCompress`",
          "type": "class",
          "name": "zlib.BrotliCompress",
          "meta": {
            "added": [
              "v11.7.0"
            ],
            "changes": []
          },
          "desc": "<p>Compress data using the Brotli algorithm.</p>"
        },
        {
          "textRaw": "Class: `zlib.BrotliDecompress`",
          "type": "class",
          "name": "zlib.BrotliDecompress",
          "meta": {
            "added": [
              "v11.7.0"
            ],
            "changes": []
          },
          "desc": "<p>Decompress data using the Brotli algorithm.</p>"
        },
        {
          "textRaw": "Class: `zlib.Deflate`",
          "type": "class",
          "name": "zlib.Deflate",
          "meta": {
            "added": [
              "v0.5.8"
            ],
            "changes": []
          },
          "desc": "<p>Compress data using deflate.</p>"
        },
        {
          "textRaw": "Class: `zlib.DeflateRaw`",
          "type": "class",
          "name": "zlib.DeflateRaw",
          "meta": {
            "added": [
              "v0.5.8"
            ],
            "changes": []
          },
          "desc": "<p>Compress data using deflate, and do not append a <code>zlib</code> header.</p>"
        },
        {
          "textRaw": "Class: `zlib.Gunzip`",
          "type": "class",
          "name": "zlib.Gunzip",
          "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": "<p>Decompress a gzip stream.</p>"
        },
        {
          "textRaw": "Class: `zlib.Gzip`",
          "type": "class",
          "name": "zlib.Gzip",
          "meta": {
            "added": [
              "v0.5.8"
            ],
            "changes": []
          },
          "desc": "<p>Compress data using gzip.</p>"
        },
        {
          "textRaw": "Class: `zlib.Inflate`",
          "type": "class",
          "name": "zlib.Inflate",
          "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": "<p>Decompress a deflate stream.</p>"
        },
        {
          "textRaw": "Class: `zlib.InflateRaw`",
          "type": "class",
          "name": "zlib.InflateRaw",
          "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": "<p>Decompress a raw deflate stream.</p>"
        },
        {
          "textRaw": "Class: `zlib.Unzip`",
          "type": "class",
          "name": "zlib.Unzip",
          "meta": {
            "added": [
              "v0.5.8"
            ],
            "changes": []
          },
          "desc": "<p>Decompress either a Gzip- or Deflate-compressed stream by auto-detecting\nthe header.</p>"
        },
        {
          "textRaw": "Class: `zlib.ZlibBase`",
          "type": "class",
          "name": "zlib.ZlibBase",
          "meta": {
            "added": [
              "v0.5.8"
            ],
            "changes": [
              {
                "version": "v11.7.0",
                "pr-url": "https://github.com/nodejs/node/pull/24939",
                "description": "This class was renamed from `Zlib` to `ZlibBase`."
              }
            ]
          },
          "desc": "<p>Not exported by the <code>zlib</code> module. It is documented here because it is the base\nclass of the compressor/decompressor classes.</p>\n<p>This class inherits from <a href=\"stream.html#stream_class_stream_transform\"><code>stream.Transform</code></a>, allowing <code>zlib</code> objects to be\nused in pipes and similar stream operations.</p>",
          "properties": [
            {
              "textRaw": "`bytesRead` {number}",
              "type": "number",
              "name": "bytesRead",
              "meta": {
                "added": [
                  "v8.1.0"
                ],
                "deprecated": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "stability": 0,
              "stabilityText": "Deprecated: Use [`zlib.bytesWritten`][] instead.",
              "desc": "<p>Deprecated alias for <a href=\"zlib.html#zlib_zlib_byteswritten\"><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>"
            },
            {
              "textRaw": "`bytesWritten` {number}",
              "type": "number",
              "name": "bytesWritten",
              "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])`",
              "type": "method",
              "name": "close",
              "meta": {
                "added": [
                  "v0.9.4"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function"
                    }
                  ]
                }
              ],
              "desc": "<p>Close the underlying handle.</p>"
            },
            {
              "textRaw": "`zlib.flush([kind, ]callback)`",
              "type": "method",
              "name": "flush",
              "meta": {
                "added": [
                  "v0.5.8"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`kind` **Default:** `zlib.constants.Z_FULL_FLUSH` for zlib-based streams, `zlib.constants.BROTLI_OPERATION_FLUSH` for Brotli-based streams.",
                      "name": "kind",
                      "default": "`zlib.constants.Z_FULL_FLUSH` for zlib-based streams, `zlib.constants.BROTLI_OPERATION_FLUSH` for Brotli-based streams"
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function"
                    }
                  ]
                }
              ],
              "desc": "<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)`",
              "type": "method",
              "name": "params",
              "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()`",
              "type": "method",
              "name": "reset",
              "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>"
            }
          ]
        }
      ],
      "properties": [
        {
          "textRaw": "`zlib.constants`",
          "name": "constants",
          "meta": {
            "added": [
              "v7.0.0"
            ],
            "changes": []
          },
          "desc": "<p>Provides an object enumerating Zlib-related constants.</p>"
        }
      ],
      "methods": [
        {
          "textRaw": "`zlib.createBrotliCompress([options])`",
          "type": "method",
          "name": "createBrotliCompress",
          "meta": {
            "added": [
              "v11.7.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`options` {brotli options}",
                  "name": "options",
                  "type": "brotli options"
                }
              ]
            }
          ],
          "desc": "<p>Creates and returns a new <a href=\"zlib.html#zlib_class_zlib_brotlicompress\"><code>BrotliCompress</code></a> object.</p>"
        },
        {
          "textRaw": "`zlib.createBrotliDecompress([options])`",
          "type": "method",
          "name": "createBrotliDecompress",
          "meta": {
            "added": [
              "v11.7.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`options` {brotli options}",
                  "name": "options",
                  "type": "brotli options"
                }
              ]
            }
          ],
          "desc": "<p>Creates and returns a new <a href=\"zlib.html#zlib_class_zlib_brotlidecompress\"><code>BrotliDecompress</code></a> object.</p>"
        },
        {
          "textRaw": "`zlib.createDeflate([options])`",
          "type": "method",
          "name": "createDeflate",
          "meta": {
            "added": [
              "v0.5.8"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`options` {zlib options}",
                  "name": "options",
                  "type": "zlib options"
                }
              ]
            }
          ],
          "desc": "<p>Creates and returns a new <a href=\"zlib.html#zlib_class_zlib_deflate\"><code>Deflate</code></a> object.</p>"
        },
        {
          "textRaw": "`zlib.createDeflateRaw([options])`",
          "type": "method",
          "name": "createDeflateRaw",
          "meta": {
            "added": [
              "v0.5.8"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`options` {zlib options}",
                  "name": "options",
                  "type": "zlib options"
                }
              ]
            }
          ],
          "desc": "<p>Creates and returns a new <a href=\"zlib.html#zlib_class_zlib_deflateraw\"><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])`",
          "type": "method",
          "name": "createGunzip",
          "meta": {
            "added": [
              "v0.5.8"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`options` {zlib options}",
                  "name": "options",
                  "type": "zlib options"
                }
              ]
            }
          ],
          "desc": "<p>Creates and returns a new <a href=\"zlib.html#zlib_class_zlib_gunzip\"><code>Gunzip</code></a> object.</p>"
        },
        {
          "textRaw": "`zlib.createGzip([options])`",
          "type": "method",
          "name": "createGzip",
          "meta": {
            "added": [
              "v0.5.8"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`options` {zlib options}",
                  "name": "options",
                  "type": "zlib options"
                }
              ]
            }
          ],
          "desc": "<p>Creates and returns a new <a href=\"zlib.html#zlib_class_zlib_gzip\"><code>Gzip</code></a> object.\nSee <a href=\"zlib.html#zlib_zlib\">example</a>.</p>"
        },
        {
          "textRaw": "`zlib.createInflate([options])`",
          "type": "method",
          "name": "createInflate",
          "meta": {
            "added": [
              "v0.5.8"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`options` {zlib options}",
                  "name": "options",
                  "type": "zlib options"
                }
              ]
            }
          ],
          "desc": "<p>Creates and returns a new <a href=\"zlib.html#zlib_class_zlib_inflate\"><code>Inflate</code></a> object.</p>"
        },
        {
          "textRaw": "`zlib.createInflateRaw([options])`",
          "type": "method",
          "name": "createInflateRaw",
          "meta": {
            "added": [
              "v0.5.8"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`options` {zlib options}",
                  "name": "options",
                  "type": "zlib options"
                }
              ]
            }
          ],
          "desc": "<p>Creates and returns a new <a href=\"zlib.html#zlib_class_zlib_inflateraw\"><code>InflateRaw</code></a> object.</p>"
        },
        {
          "textRaw": "`zlib.createUnzip([options])`",
          "type": "method",
          "name": "createUnzip",
          "meta": {
            "added": [
              "v0.5.8"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`options` {zlib options}",
                  "name": "options",
                  "type": "zlib options"
                }
              ]
            }
          ],
          "desc": "<p>Creates and returns a new <a href=\"zlib.html#zlib_class_zlib_unzip\"><code>Unzip</code></a> object.</p>"
        },
        {
          "textRaw": "`zlib.brotliCompress(buffer[, options], callback)`",
          "type": "method",
          "name": "brotliCompress",
          "meta": {
            "added": [
              "v11.7.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"
                },
                {
                  "textRaw": "`callback` {Function}",
                  "name": "callback",
                  "type": "Function"
                }
              ]
            }
          ]
        },
        {
          "textRaw": "`zlib.brotliCompressSync(buffer[, options])`",
          "type": "method",
          "name": "brotliCompressSync",
          "meta": {
            "added": [
              "v11.7.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"
                }
              ]
            }
          ],
          "desc": "<p>Compress a chunk of data with <a href=\"zlib.html#zlib_class_zlib_brotlicompress\"><code>BrotliCompress</code></a>.</p>"
        },
        {
          "textRaw": "`zlib.brotliDecompress(buffer[, options], callback)`",
          "type": "method",
          "name": "brotliDecompress",
          "meta": {
            "added": [
              "v11.7.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"
                },
                {
                  "textRaw": "`callback` {Function}",
                  "name": "callback",
                  "type": "Function"
                }
              ]
            }
          ]
        },
        {
          "textRaw": "`zlib.brotliDecompressSync(buffer[, options])`",
          "type": "method",
          "name": "brotliDecompressSync",
          "meta": {
            "added": [
              "v11.7.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"
                }
              ]
            }
          ],
          "desc": "<p>Decompress a chunk of data with <a href=\"zlib.html#zlib_class_zlib_brotlidecompress\"><code>BrotliDecompress</code></a>.</p>"
        },
        {
          "textRaw": "`zlib.deflate(buffer[, options], callback)`",
          "type": "method",
          "name": "deflate",
          "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"
                },
                {
                  "textRaw": "`callback` {Function}",
                  "name": "callback",
                  "type": "Function"
                }
              ]
            }
          ]
        },
        {
          "textRaw": "`zlib.deflateSync(buffer[, options])`",
          "type": "method",
          "name": "deflateSync",
          "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"
                }
              ]
            }
          ],
          "desc": "<p>Compress a chunk of data with <a href=\"zlib.html#zlib_class_zlib_deflate\"><code>Deflate</code></a>.</p>"
        },
        {
          "textRaw": "`zlib.deflateRaw(buffer[, options], callback)`",
          "type": "method",
          "name": "deflateRaw",
          "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"
                },
                {
                  "textRaw": "`callback` {Function}",
                  "name": "callback",
                  "type": "Function"
                }
              ]
            }
          ]
        },
        {
          "textRaw": "`zlib.deflateRawSync(buffer[, options])`",
          "type": "method",
          "name": "deflateRawSync",
          "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"
                }
              ]
            }
          ],
          "desc": "<p>Compress a chunk of data with <a href=\"zlib.html#zlib_class_zlib_deflateraw\"><code>DeflateRaw</code></a>.</p>"
        },
        {
          "textRaw": "`zlib.gunzip(buffer[, options], callback)`",
          "type": "method",
          "name": "gunzip",
          "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"
                },
                {
                  "textRaw": "`callback` {Function}",
                  "name": "callback",
                  "type": "Function"
                }
              ]
            }
          ]
        },
        {
          "textRaw": "`zlib.gunzipSync(buffer[, options])`",
          "type": "method",
          "name": "gunzipSync",
          "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"
                }
              ]
            }
          ],
          "desc": "<p>Decompress a chunk of data with <a href=\"zlib.html#zlib_class_zlib_gunzip\"><code>Gunzip</code></a>.</p>"
        },
        {
          "textRaw": "`zlib.gzip(buffer[, options], callback)`",
          "type": "method",
          "name": "gzip",
          "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"
                },
                {
                  "textRaw": "`callback` {Function}",
                  "name": "callback",
                  "type": "Function"
                }
              ]
            }
          ]
        },
        {
          "textRaw": "`zlib.gzipSync(buffer[, options])`",
          "type": "method",
          "name": "gzipSync",
          "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"
                }
              ]
            }
          ],
          "desc": "<p>Compress a chunk of data with <a href=\"zlib.html#zlib_class_zlib_gzip\"><code>Gzip</code></a>.</p>"
        },
        {
          "textRaw": "`zlib.inflate(buffer[, options], callback)`",
          "type": "method",
          "name": "inflate",
          "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"
                },
                {
                  "textRaw": "`callback` {Function}",
                  "name": "callback",
                  "type": "Function"
                }
              ]
            }
          ]
        },
        {
          "textRaw": "`zlib.inflateSync(buffer[, options])`",
          "type": "method",
          "name": "inflateSync",
          "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"
                }
              ]
            }
          ],
          "desc": "<p>Decompress a chunk of data with <a href=\"zlib.html#zlib_class_zlib_inflate\"><code>Inflate</code></a>.</p>"
        },
        {
          "textRaw": "`zlib.inflateRaw(buffer[, options], callback)`",
          "type": "method",
          "name": "inflateRaw",
          "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"
                },
                {
                  "textRaw": "`callback` {Function}",
                  "name": "callback",
                  "type": "Function"
                }
              ]
            }
          ]
        },
        {
          "textRaw": "`zlib.inflateRawSync(buffer[, options])`",
          "type": "method",
          "name": "inflateRawSync",
          "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"
                }
              ]
            }
          ],
          "desc": "<p>Decompress a chunk of data with <a href=\"zlib.html#zlib_class_zlib_inflateraw\"><code>InflateRaw</code></a>.</p>"
        },
        {
          "textRaw": "`zlib.unzip(buffer[, options], callback)`",
          "type": "method",
          "name": "unzip",
          "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"
                },
                {
                  "textRaw": "`callback` {Function}",
                  "name": "callback",
                  "type": "Function"
                }
              ]
            }
          ]
        },
        {
          "textRaw": "`zlib.unzipSync(buffer[, options])`",
          "type": "method",
          "name": "unzipSync",
          "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"
                }
              ]
            }
          ],
          "desc": "<p>Decompress a chunk of data with <a href=\"zlib.html#zlib_class_zlib_unzip\"><code>Unzip</code></a>.</p>"
        }
      ],
      "type": "module",
      "displayName": "Zlib"
    }
  ],
  "classes": [
    {
      "textRaw": "Class: `Error`",
      "type": "class",
      "name": "Error",
      "desc": "<p>A generic JavaScript <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error\" class=\"type\">&lt;Error&gt;</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>",
      "methods": [
        {
          "textRaw": "`Error.captureStackTrace(targetObject[, constructorOpt])`",
          "type": "method",
          "name": "captureStackTrace",
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`targetObject` {Object}",
                  "name": "targetObject",
                  "type": "Object"
                },
                {
                  "textRaw": "`constructorOpt` {Function}",
                  "name": "constructorOpt",
                  "type": "Function"
                }
              ]
            }
          ],
          "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 an end user. For instance:</p>\n<pre><code class=\"language-js\">function MyError() {\n  Error.captureStackTrace(this, MyError);\n}\n\n// Without passing MyError to captureStackTrace, the MyError\n// frame would show up in the .stack property. By passing\n// the constructor, we omit that frame, and retain all frames below it.\nnew MyError().stack;\n</code></pre>"
        }
      ],
      "properties": [
        {
          "textRaw": "`stackTraceLimit` {number}",
          "type": "number",
          "name": "stackTraceLimit",
          "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": "`code` {string}",
          "type": "string",
          "name": "code",
          "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=\"errors.html#nodejs-error-codes\">Node.js error codes</a> for details\nabout specific codes.</p>"
        },
        {
          "textRaw": "`message` {string}",
          "type": "string",
          "name": "message",
          "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": "`stack` {string}",
          "type": "string",
          "name": "stack",
          "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, or its dependencies.</li>\n</ul>\n<p>The string representing the stack trace is lazily generated when the\n<code>error.stack</code> property is <strong>accessed</strong>.</p>\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>"
        }
      ],
      "signatures": [
        {
          "params": [
            {
              "textRaw": "`message` {string}",
              "name": "message",
              "type": "string"
            }
          ],
          "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>message.toString()</code>. 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://github.com/v8/v8/wiki/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>"
        }
      ]
    },
    {
      "textRaw": "Class: `AssertionError`",
      "type": "class",
      "name": "AssertionError",
      "desc": "<ul>\n<li>Extends: <a href=\"errors.html#errors_class_error\" class=\"type\">&lt;errors.Error&gt;</a></li>\n</ul>\n<p>Indicates the failure of an assertion. For details, see\n<a href=\"assert.html#assert_class_assert_assertionerror\"><code>Class: assert.AssertionError</code></a>.</p>"
    },
    {
      "textRaw": "Class: `RangeError`",
      "type": "class",
      "name": "RangeError",
      "desc": "<ul>\n<li>Extends: <a href=\"errors.html#errors_class_error\" class=\"type\">&lt;errors.Error&gt;</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('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`",
      "type": "class",
      "name": "ReferenceError",
      "desc": "<ul>\n<li>Extends: <a href=\"errors.html#errors_class_error\" class=\"type\">&lt;errors.Error&gt;</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 should always be considered a bug in the code\nor its dependencies.</p>"
    },
    {
      "textRaw": "Class: `SyntaxError`",
      "type": "class",
      "name": "SyntaxError",
      "desc": "<ul>\n<li>Extends: <a href=\"errors.html#errors_class_error\" class=\"type\">&lt;errors.Error&gt;</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('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`",
      "type": "class",
      "name": "SystemError",
      "desc": "<ul>\n<li>Extends: <a href=\"errors.html#errors_class_error\" class=\"type\">&lt;errors.Error&gt;</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/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string&gt;</a> If present, the address to which a network connection\nfailed</li>\n<li><code>code</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string&gt;</a> The string error code</li>\n<li><code>dest</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string&gt;</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/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;number&gt;</a> | <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string&gt;</a> The system-provided error number</li>\n<li><code>info</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object\" class=\"type\">&lt;Object&gt;</a> If present, extra details about the error condition</li>\n<li><code>message</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string&gt;</a> A system-provided human-readable description of the error</li>\n<li><code>path</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string&gt;</a> If present, the file path when reporting a file system error</li>\n<li><code>port</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;number&gt;</a> If present, the network connection port that is not available</li>\n<li><code>syscall</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string&gt;</a> The name of the system call that triggered the error</li>\n</ul>",
      "properties": [
        {
          "textRaw": "`address` {string}",
          "type": "string",
          "name": "address",
          "desc": "<p>If present, <code>error.address</code> is a string describing the address to which a\nnetwork connection failed.</p>"
        },
        {
          "textRaw": "`code` {string}",
          "type": "string",
          "name": "code",
          "desc": "<p>The <code>error.code</code> property is a string representing the error code.</p>"
        },
        {
          "textRaw": "`dest` {string}",
          "type": "string",
          "name": "dest",
          "desc": "<p>If present, <code>error.dest</code> is the file path destination when reporting a file\nsystem error.</p>"
        },
        {
          "textRaw": "`errno` {string|number}",
          "type": "string|number",
          "name": "errno",
          "desc": "<p>The <code>error.errno</code> property is a number or a string. If it is a number, it is a\nnegative value which corresponds to the error code defined in\n<a href=\"http://docs.libuv.org/en/v1.x/errors.html\"><code>libuv Error handling</code></a>. See the libuv <code>errno.h</code> header file\n(<code>deps/uv/include/uv/errno.h</code> in the Node.js source tree) for details. In case\nof a string, it is the same as <code>error.code</code>.</p>"
        },
        {
          "textRaw": "`info` {Object}",
          "type": "Object",
          "name": "info",
          "desc": "<p>If present, <code>error.info</code> is an object with details about the error condition.</p>"
        },
        {
          "textRaw": "`message` {string}",
          "type": "string",
          "name": "message",
          "desc": "<p><code>error.message</code> is a system-provided human-readable description of the error.</p>"
        },
        {
          "textRaw": "`path` {string}",
          "type": "string",
          "name": "path",
          "desc": "<p>If present, <code>error.path</code> is a string containing a relevant invalid pathname.</p>"
        },
        {
          "textRaw": "`port` {number}",
          "type": "number",
          "name": "port",
          "desc": "<p>If present, <code>error.port</code> is the network connection port that is not available.</p>"
        },
        {
          "textRaw": "`syscall` {string}",
          "type": "string",
          "name": "syscall",
          "desc": "<p>The <code>error.syscall</code> property is a string describing the <a href=\"http://man7.org/linux/man-pages/man2/syscalls.2.html\">syscall</a> that failed.</p>"
        }
      ],
      "modules": [
        {
          "textRaw": "Common system errors",
          "name": "common_system_errors",
          "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=\"http://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#fs_fs_readdir_path_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#fs_fs_unlink_path_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>",
          "type": "module",
          "displayName": "Common system errors"
        }
      ]
    },
    {
      "textRaw": "Class: `TypeError`",
      "type": "class",
      "name": "TypeError",
      "desc": "<ul>\n<li>Extends <a href=\"errors.html#errors_class_error\" class=\"type\">&lt;errors.Error&gt;</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 considered\na <code>TypeError</code>.</p>\n<pre><code class=\"language-js\">require('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>"
    }
  ],
  "globals": [
    {
      "textRaw": "Class: `Buffer`",
      "type": "global",
      "name": "Buffer",
      "meta": {
        "added": [
          "v0.1.103"
        ],
        "changes": []
      },
      "desc": "<ul>\n<li><a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function\" class=\"type\">&lt;Function&gt;</a></li>\n</ul>\n<p>Used to handle binary data. See the <a href=\"buffer.html\">buffer section</a>.</p>"
    },
    {
      "textRaw": "`clearImmediate(immediateObject)`",
      "type": "global",
      "name": "clearImmediate",
      "meta": {
        "added": [
          "v0.9.1"
        ],
        "changes": []
      },
      "desc": "<p><a href=\"timers.html#timers_clearimmediate_immediate\"><code>clearImmediate</code></a> is described in the <a href=\"timers.html\">timers</a> section.</p>"
    },
    {
      "textRaw": "`clearInterval(intervalObject)`",
      "type": "global",
      "name": "clearInterval",
      "meta": {
        "added": [
          "v0.0.1"
        ],
        "changes": []
      },
      "desc": "<p><a href=\"timers.html#timers_clearinterval_timeout\"><code>clearInterval</code></a> is described in the <a href=\"timers.html\">timers</a> section.</p>"
    },
    {
      "textRaw": "`clearTimeout(timeoutObject)`",
      "type": "global",
      "name": "clearTimeout",
      "meta": {
        "added": [
          "v0.0.1"
        ],
        "changes": []
      },
      "desc": "<p><a href=\"timers.html#timers_cleartimeout_timeout\"><code>clearTimeout</code></a> is described in the <a href=\"timers.html\">timers</a> section.</p>"
    },
    {
      "textRaw": "`console`",
      "name": "`console`",
      "meta": {
        "added": [
          "v0.1.100"
        ],
        "changes": []
      },
      "type": "global",
      "desc": "<ul>\n<li><a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object\" class=\"type\">&lt;Object&gt;</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>"
    },
    {
      "textRaw": "`global`",
      "name": "`global`",
      "meta": {
        "added": [
          "v0.1.27"
        ],
        "changes": []
      },
      "type": "global",
      "desc": "<ul>\n<li><a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object\" class=\"type\">&lt;Object&gt;</a> The global namespace object.</li>\n</ul>\n<p>In browsers, the top-level scope is the global scope. This means that\nwithin the browser <code>var something</code> will define a new global variable. In\nNode.js this is different. The top-level scope is not the global scope;\n<code>var something</code> inside a Node.js module will be local to that module.</p>"
    },
    {
      "textRaw": "`process`",
      "name": "`process`",
      "meta": {
        "added": [
          "v0.1.7"
        ],
        "changes": []
      },
      "type": "global",
      "desc": "<ul>\n<li><a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object\" class=\"type\">&lt;Object&gt;</a></li>\n</ul>\n<p>The process object. See the <a href=\"process.html#process_process\"><code>process</code> object</a> section.</p>"
    },
    {
      "textRaw": "`queueMicrotask(callback)`",
      "type": "global",
      "name": "queueMicrotask",
      "meta": {
        "added": [
          "v11.0.0"
        ],
        "changes": []
      },
      "desc": "<ul>\n<li><code>callback</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function\" class=\"type\">&lt;Function&gt;</a> Function to be queued.</li>\n</ul>\n<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_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#process_process_nexttick_callback_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(url);\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(url, data);\n  this.emit('load', data);\n};\n</code></pre>"
    },
    {
      "textRaw": "`setImmediate(callback[, ...args])`",
      "type": "global",
      "name": "setImmediate",
      "meta": {
        "added": [
          "v0.9.1"
        ],
        "changes": []
      },
      "desc": "<p><a href=\"timers.html#timers_setimmediate_callback_args\"><code>setImmediate</code></a> is described in the <a href=\"timers.html\">timers</a> section.</p>"
    },
    {
      "textRaw": "`setInterval(callback, delay[, ...args])`",
      "type": "global",
      "name": "setInterval",
      "meta": {
        "added": [
          "v0.0.1"
        ],
        "changes": []
      },
      "desc": "<p><a href=\"timers.html#timers_setinterval_callback_delay_args\"><code>setInterval</code></a> is described in the <a href=\"timers.html\">timers</a> section.</p>"
    },
    {
      "textRaw": "`setTimeout(callback, delay[, ...args])`",
      "type": "global",
      "name": "setTimeout",
      "meta": {
        "added": [
          "v0.0.1"
        ],
        "changes": []
      },
      "desc": "<p><a href=\"timers.html#timers_settimeout_callback_delay_args\"><code>setTimeout</code></a> is described in the <a href=\"timers.html\">timers</a> section.</p>"
    },
    {
      "textRaw": "`TextDecoder`",
      "name": "`TextDecoder`",
      "meta": {
        "added": [
          "v11.0.0"
        ],
        "changes": []
      },
      "type": "global",
      "desc": "<p>The WHATWG <code>TextDecoder</code> class. See the <a href=\"util.html#util_class_util_textdecoder\"><code>TextDecoder</code></a> section.</p>"
    },
    {
      "textRaw": "`TextEncoder`",
      "name": "`TextEncoder`",
      "meta": {
        "added": [
          "v11.0.0"
        ],
        "changes": []
      },
      "type": "global",
      "desc": "<p>The WHATWG <code>TextEncoder</code> class. See the <a href=\"util.html#util_class_util_textencoder\"><code>TextEncoder</code></a> section.</p>"
    },
    {
      "textRaw": "`URL`",
      "name": "`URL`",
      "meta": {
        "added": [
          "v10.0.0"
        ],
        "changes": []
      },
      "type": "global",
      "desc": "<p>The WHATWG <code>URL</code> class. See the <a href=\"url.html#url_class_url\"><code>URL</code></a> section.</p>"
    },
    {
      "textRaw": "`URLSearchParams`",
      "name": "`URLSearchParams`",
      "meta": {
        "added": [
          "v10.0.0"
        ],
        "changes": []
      },
      "type": "global",
      "desc": "<p>The WHATWG <code>URLSearchParams</code> class. See the <a href=\"url.html#url_class_urlsearchparams\"><code>URLSearchParams</code></a> section.</p>"
    },
    {
      "textRaw": "`WebAssembly`",
      "name": "`WebAssembly`",
      "meta": {
        "added": [
          "v8.0.0"
        ],
        "changes": []
      },
      "type": "global",
      "desc": "<ul>\n<li><a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object\" class=\"type\">&lt;Object&gt;</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": "Process",
      "name": "Process",
      "introduced_in": "v0.10.0",
      "type": "global",
      "desc": "<p>The <code>process</code> object is a <code>global</code> that provides information about, and control\nover, the current Node.js process. As a global, it is always available to\nNode.js applications without using <code>require()</code>. It can also be explicitly\naccessed using <code>require()</code>:</p>\n<pre><code class=\"language-js\">const process = require('process');\n</code></pre>",
      "modules": [
        {
          "textRaw": "Process events",
          "name": "process_events",
          "desc": "<p>The <code>process</code> object is an instance of <a href=\"events.html#events_class_eventemitter\"><code>EventEmitter</code></a>.</p>",
          "events": [
            {
              "textRaw": "Event: `'beforeExit'`",
              "type": "event",
              "name": "beforeExit",
              "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=\"process.html#process_process_exitcode\"><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=\"process.html#process_process_exit_code\"><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-js\">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'`",
              "type": "event",
              "name": "disconnect",
              "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'`",
              "type": "event",
              "name": "exit",
              "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=\"process.html#process_process_exitcode\"><code>process.exitCode</code></a> property, or the <code>exitCode</code> argument passed to the\n<a href=\"process.html#process_process_exit_code\"><code>process.exit()</code></a> method.</p>\n<pre><code class=\"language-js\">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-js\">process.on('exit', (code) => {\n  setTimeout(() => {\n    console.log('This will not run');\n  }, 0);\n});\n</code></pre>"
            },
            {
              "textRaw": "Event: `'message'`",
              "type": "event",
              "name": "message",
              "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#child_process_subprocess_send_message_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#child_process_advanced_serialization\">Advanced serialization for <code>child_process</code></a> for more details.</p>"
            },
            {
              "textRaw": "Event: `'multipleResolves'`",
              "type": "event",
              "name": "multipleResolves",
              "meta": {
                "added": [
                  "v10.12.0"
                ],
                "changes": []
              },
              "params": [
                {
                  "textRaw": "`type` {string} The resolution type. One of `'resolve'` or `'reject'`.",
                  "name": "type",
                  "type": "string",
                  "desc": "The resolution type. One of `'resolve'` or `'reject'`."
                },
                {
                  "textRaw": "`promise` {Promise} The promise that resolved or rejected more than once.",
                  "name": "promise",
                  "type": "Promise",
                  "desc": "The promise that resolved or rejected more than once."
                },
                {
                  "textRaw": "`value` {any} The value with which the promise was either resolved or rejected after the original resolve.",
                  "name": "value",
                  "type": "any",
                  "desc": "The value with which the promise was either resolved or rejected after the original resolve."
                }
              ],
              "desc": "<p>The <code>'multipleResolves'</code> event is emitted whenever a <code>Promise</code> has been either:</p>\n<ul>\n<li>Resolved more than once.</li>\n<li>Rejected more than once.</li>\n<li>Rejected after resolve.</li>\n<li>Resolved after reject.</li>\n</ul>\n<p>This is useful for tracking potential errors in an application while using the\n<code>Promise</code> constructor, as multiple resolutions are silently swallowed. However,\nthe occurrence of this event does not necessarily indicate an error. For\nexample, <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/race\"><code>Promise.race()</code></a> can trigger a <code>'multipleResolves'</code> event.</p>\n<pre><code class=\"language-js\">process.on('multipleResolves', (type, promise, reason) => {\n  console.error(type, promise, reason);\n  setImmediate(() => process.exit(1));\n});\n\nasync function main() {\n  try {\n    return await new Promise((resolve, reject) => {\n      resolve('First call');\n      resolve('Swallowed resolve');\n      reject(new Error('Swallowed reject'));\n    });\n  } catch {\n    throw new Error('Failed');\n  }\n}\n\nmain().then(console.log);\n// resolve: Promise { 'First call' } 'Swallowed resolve'\n// reject: Promise { 'First call' } Error: Swallowed reject\n//     at Promise (*)\n//     at new Promise (&#x3C;anonymous>)\n//     at main (*)\n// First call\n</code></pre>"
            },
            {
              "textRaw": "Event: `'rejectionHandled'`",
              "type": "event",
              "name": "rejectionHandled",
              "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-js\">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: `'uncaughtException'`",
              "type": "event",
              "name": "uncaughtException",
              "meta": {
                "added": [
                  "v0.1.18"
                ],
                "changes": [
                  {
                    "version": "v12.0.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 an synchronous error. Can either be `'uncaughtException'` or `'unhandledRejection'`. The latter is only used in conjunction with the [`--unhandled-rejections`][] flag set to `strict` and an unhandled rejection.",
                  "name": "origin",
                  "type": "string",
                  "desc": "Indicates if the exception originates from an unhandled rejection or from an synchronous error. Can either be `'uncaughtException'` or `'unhandledRejection'`. The latter is only used in conjunction with the [`--unhandled-rejections`][] flag set to `strict` and an unhandled rejection."
                }
              ],
              "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=\"process.html#process_process_exitcode\"><code>process.exitCode</code></a>.\nAdding a handler for the <code>'uncaughtException'</code> event overrides this default\nbehavior. Alternatively, change the <a href=\"process.html#process_process_exitcode\"><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-js\">process.on('uncaughtException', (err, origin) => {\n  fs.writeSync(\n    process.stderr.fd,\n    `Caught exception: ${err}\\n` +\n    `Exception origin: ${origin}`\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",
                  "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>",
                  "type": "module",
                  "displayName": "Warning: Using `'uncaughtException'` correctly"
                }
              ]
            },
            {
              "textRaw": "Event: `'uncaughtExceptionMonitor'`",
              "type": "event",
              "name": "uncaughtExceptionMonitor",
              "meta": {
                "added": [
                  "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'`.",
                  "name": "origin",
                  "type": "string",
                  "desc": "Indicates if the exception originates from an unhandled rejection or from synchronous errors. Can either be `'uncaughtException'` or `'unhandledRejection'`."
                }
              ],
              "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=\"process.html#process_process_setuncaughtexceptioncapturecallback_fn\"><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-js\">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'`",
              "type": "event",
              "name": "unhandledRejection",
              "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-js\">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-js\">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>"
            },
            {
              "textRaw": "Event: `'warning'`",
              "type": "event",
              "name": "warning",
              "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-js\">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.</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",
                  "desc": "<p>See the <a href=\"process.html#process_process_emitwarning_warning_type_code_ctor\"><code>process.emitWarning()</code></a> method for issuing\ncustom or application-specific warnings.</p>",
                  "type": "module",
                  "displayName": "Emitting custom warnings"
                }
              ]
            },
            {
              "textRaw": "Signal events",
              "name": "SIGINT, SIGHUP, etc.",
              "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\n<code>'SIGINT'</code>, <code>'SIGHUP'</code>, etc.</p>\n<p>Signals are not available on <a href=\"worker_threads.html#worker_threads_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-js\">// 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 <code>&#x3C;Ctrl>+C</code> (though this may be configurable). It is not\ngenerated when <a href=\"tty.html#tty_readstream_setrawmode_mode\">terminal raw mode</a> is enabled and <code>&#x3C;Ctrl>+C</code> is used.</li>\n<li><code>'SIGBREAK'</code> is delivered on Windows when <code>&#x3C;Ctrl>+&#x3C;Break></code> is pressed, on\nnon-Windows platforms it can be listened on, but there is no way to send or\ngenerate 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\n artificially 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\n which it is not safe to attempt to call JS listeners. Doing so might lead to\n the process hanging in an endless loop, since listeners attached using\n <code>process.on()</code> are called asynchronously and therefore unable to correct the\nunderlying problem.</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=\"process.html#process_process_kill_pid_signal\"><code>process.kill()</code></a>, and\n<a href=\"child_process.html#child_process_subprocess_kill_signal\"><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>"
            }
          ],
          "type": "module",
          "displayName": "Process events"
        },
        {
          "textRaw": "Exit codes",
          "name": "exit_codes",
          "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=\"process.html#process_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=\"process.html#process_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>>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>",
          "type": "module",
          "displayName": "Exit codes"
        }
      ],
      "methods": [
        {
          "textRaw": "`process.abort()`",
          "type": "method",
          "name": "abort",
          "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#worker_threads_class_worker\"><code>Worker</code></a> threads.</p>"
        },
        {
          "textRaw": "`process.chdir(directory)`",
          "type": "method",
          "name": "chdir",
          "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-js\">console.log(`Starting directory: ${process.cwd()}`);\ntry {\n  process.chdir('/tmp');\n  console.log(`New directory: ${process.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#worker_threads_class_worker\"><code>Worker</code></a> threads.</p>"
        },
        {
          "textRaw": "`process.cpuUsage([previousValue])`",
          "type": "method",
          "name": "cpuUsage",
          "meta": {
            "added": [
              "v6.1.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "return": {
                "textRaw": "Returns: {Object}",
                "name": "return",
                "type": "Object",
                "options": [
                  {
                    "textRaw": "`user` {integer}",
                    "name": "user",
                    "type": "integer"
                  },
                  {
                    "textRaw": "`system` {integer}",
                    "name": "system",
                    "type": "integer"
                  }
                ]
              },
              "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()`"
                }
              ]
            }
          ],
          "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-js\">const startUsage = process.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(process.cpuUsage(startUsage));\n// { user: 514883, system: 11226 }\n</code></pre>"
        },
        {
          "textRaw": "`process.cwd()`",
          "type": "method",
          "name": "cwd",
          "meta": {
            "added": [
              "v0.1.8"
            ],
            "changes": []
          },
          "signatures": [
            {
              "return": {
                "textRaw": "Returns: {string}",
                "name": "return",
                "type": "string"
              },
              "params": []
            }
          ],
          "desc": "<p>The <code>process.cwd()</code> method returns the current working directory of the Node.js\nprocess.</p>\n<pre><code class=\"language-js\">console.log(`Current directory: ${process.cwd()}`);\n</code></pre>"
        },
        {
          "textRaw": "`process.disconnect()`",
          "type": "method",
          "name": "disconnect",
          "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#child_process_subprocess_disconnect\"><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])`",
          "type": "method",
          "name": "dlopen",
          "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`"
                }
              ]
            }
          ],
          "desc": "<p>The <code>process.dlopen()</code> method allows to dynamically load shared\nobjects. It is primarily used by <code>require()</code> to load\nC++ Addons, and should not be used directly, except in special\ncases. In other words, <a href=\"globals.html#globals_require\"><code>require()</code></a> should be preferred over\n<code>process.dlopen()</code>, unless there are specific reasons.</p>\n<p>The <code>flags</code> argument is an integer that allows to specify dlopen\nbehavior. See the <a href=\"os.html#os_dlopen_constants\"><code>os.constants.dlopen</code></a> documentation for details.</p>\n<p>If there are specific reasons to use <code>process.dlopen()</code> (for instance,\nto specify dlopen flags), it's often useful to use <a href=\"modules.html#modules_require_resolve_request_options\"><code>require.resolve()</code></a>\nto look up the module's path.</p>\n<p>An important drawback when calling <code>process.dlopen()</code> is that the <code>module</code>\ninstance must be passed. Functions exported by the C++ Addon will be accessible\nvia <code>module.exports</code>.</p>\n<p>The example below shows how to load a C++ Addon, named as <code>binding</code>,\nthat exports a <code>foo</code> function. All the symbols will be 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-js\">const os = require('os');\nprocess.dlopen(module, require.resolve('binding'),\n               os.constants.dlopen.RTLD_NOW);\nmodule.exports.foo();\n</code></pre>"
        },
        {
          "textRaw": "`process.emitWarning(warning[, options])`",
          "type": "method",
          "name": "emitWarning",
          "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."
                    }
                  ]
                }
              ]
            }
          ],
          "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=\"process.html#process_event_warning\"><code>'warning'</code></a> event.</p>\n<pre><code class=\"language-js\">// Emit a warning with a code and additional detail.\nprocess.emitWarning('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=\"process.html#process_event_warning\"><code>'warning'</code></a> handler.</p>\n<pre><code class=\"language-js\">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])`",
          "type": "method",
          "name": "emitWarning",
          "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."
                },
                {
                  "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."
                }
              ]
            }
          ],
          "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=\"process.html#process_event_warning\"><code>'warning'</code></a> event.</p>\n<pre><code class=\"language-js\">// Emit a warning using a string.\nprocess.emitWarning('Something happened!');\n// Emits: (node: 56338) Warning: Something happened!\n</code></pre>\n<pre><code class=\"language-js\">// Emit a warning using a string and a type.\nprocess.emitWarning('Something Happened!', 'CustomWarning');\n// Emits: (node:56338) CustomWarning: Something Happened!\n</code></pre>\n<pre><code class=\"language-js\">process.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=\"process.html#process_event_warning\"><code>'warning'</code></a>\nhandler.</p>\n<pre><code class=\"language-js\">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-js\">// 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\nprocess.emitWarning(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",
              "desc": "<p>As a best practice, warnings should be emitted only once per process. To do\nso, it is recommended to place the <code>emitWarning()</code> behind a simple boolean\nflag as illustrated in the example below:</p>\n<pre><code class=\"language-js\">function emitMyWarning() {\n  if (!emitMyWarning.warned) {\n    emitMyWarning.warned = true;\n    process.emitWarning('Only warn once!');\n  }\n}\nemitMyWarning();\n// Emits: (node: 56339) Warning: Only warn once!\nemitMyWarning();\n// Emits nothing\n</code></pre>",
              "type": "module",
              "displayName": "Avoiding duplicate warnings"
            }
          ]
        },
        {
          "textRaw": "`process.exit([code])`",
          "type": "method",
          "name": "exit",
          "meta": {
            "added": [
              "v0.1.13"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`code` {integer} The exit code. **Default:** `0`.",
                  "name": "code",
                  "type": "integer",
                  "default": "`0`",
                  "desc": "The exit code."
                }
              ]
            }
          ],
          "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=\"process.html#process_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-js\">process.exit(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-js\">// This is an example of what *not* to do:\nif (someConditionNotMet()) {\n  printUsageToStdout();\n  process.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-js\">// 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#worker_threads_class_worker\"><code>Worker</code></a> threads, this function stops the current thread rather\nthan the current process.</p>"
        },
        {
          "textRaw": "`process.getegid()`",
          "type": "method",
          "name": "getegid",
          "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-js\">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()`",
          "type": "method",
          "name": "geteuid",
          "meta": {
            "added": [
              "v2.0.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "return": {
                "textRaw": "Returns: {Object}",
                "name": "return",
                "type": "Object"
              },
              "params": []
            }
          ],
          "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-js\">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()`",
          "type": "method",
          "name": "getgid",
          "meta": {
            "added": [
              "v0.1.31"
            ],
            "changes": []
          },
          "signatures": [
            {
              "return": {
                "textRaw": "Returns: {Object}",
                "name": "return",
                "type": "Object"
              },
              "params": []
            }
          ],
          "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-js\">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()`",
          "type": "method",
          "name": "getgroups",
          "meta": {
            "added": [
              "v0.9.4"
            ],
            "changes": []
          },
          "signatures": [
            {
              "return": {
                "textRaw": "Returns: {integer[]}",
                "name": "return",
                "type": "integer[]"
              },
              "params": []
            }
          ],
          "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<p>This function is only available on POSIX platforms (i.e. not Windows or\nAndroid).</p>"
        },
        {
          "textRaw": "`process.getuid()`",
          "type": "method",
          "name": "getuid",
          "meta": {
            "added": [
              "v0.1.28"
            ],
            "changes": []
          },
          "signatures": [
            {
              "return": {
                "textRaw": "Returns: {integer}",
                "name": "return",
                "type": "integer"
              },
              "params": []
            }
          ],
          "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-js\">if (process.getuid) {\n  console.log(`Current uid: ${process.getuid()}`);\n}\n</code></pre>\n<p>This function is only available on POSIX platforms (i.e. not Windows or\nAndroid).</p>"
        },
        {
          "textRaw": "`process.hasUncaughtExceptionCaptureCallback()`",
          "type": "method",
          "name": "hasUncaughtExceptionCaptureCallback",
          "meta": {
            "added": [
              "v9.3.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "return": {
                "textRaw": "Returns: {boolean}",
                "name": "return",
                "type": "boolean"
              },
              "params": []
            }
          ],
          "desc": "<p>Indicates whether a callback has been set using\n<a href=\"process.html#process_process_setuncaughtexceptioncapturecallback_fn\"><code>process.setUncaughtExceptionCaptureCallback()</code></a>.</p>"
        },
        {
          "textRaw": "`process.hrtime([time])`",
          "type": "method",
          "name": "hrtime",
          "meta": {
            "added": [
              "v0.7.6"
            ],
            "changes": []
          },
          "signatures": [
            {
              "return": {
                "textRaw": "Returns: {integer[]}",
                "name": "return",
                "type": "integer[]"
              },
              "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()`"
                }
              ]
            }
          ],
          "desc": "<p>This is the legacy version of <a href=\"process.html#process_process_hrtime_bigint\"><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-js\">const NS_PER_SEC = 1e9;\nconst time = process.hrtime();\n// [ 1800216, 25 ]\n\nsetTimeout(() => {\n  const diff = process.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()`",
          "type": "method",
          "name": "bigint",
          "meta": {
            "added": [
              "v10.7.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "return": {
                "textRaw": "Returns: {bigint}",
                "name": "return",
                "type": "bigint"
              },
              "params": []
            }
          ],
          "desc": "<p>The <code>bigint</code> version of the <a href=\"process.html#process_process_hrtime_time\"><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=\"process.html#process_process_hrtime_time\"><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-js\">const start = process.hrtime.bigint();\n// 191051479007711n\n\nsetTimeout(() => {\n  const end = process.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)`",
          "type": "method",
          "name": "initgroups",
          "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-js\">console.log(process.getgroups());         // [ 0 ]\nprocess.initgroups('bnoordhuis', 1000);   // switch user\nconsole.log(process.getgroups());         // [ 27, 30, 46, 1000, 0 ]\nprocess.setgid(1000);                     // drop root gid\nconsole.log(process.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#worker_threads_class_worker\"><code>Worker</code></a> threads.</p>"
        },
        {
          "textRaw": "`process.kill(pid[, signal])`",
          "type": "method",
          "name": "kill",
          "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."
                }
              ]
            }
          ],
          "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=\"process.html#process_signal_events\">Signal Events</a>\nand <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-js\">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=\"process.html#process_signal_events\">Signal Events</a>.</p>"
        },
        {
          "textRaw": "`process.memoryUsage()`",
          "type": "method",
          "name": "memoryUsage",
          "meta": {
            "added": [
              "v0.1.16"
            ],
            "changes": [
              {
                "version": "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": [
            {
              "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"
                  }
                ]
              },
              "params": []
            }
          ],
          "desc": "<p>The <code>process.memoryUsage()</code> method returns an object describing the memory usage\nof the Node.js process measured in bytes.</p>\n<p>For example, the code:</p>\n<pre><code class=\"language-js\">console.log(process.memoryUsage());\n</code></pre>\n<p>Will generate:</p>\n<!-- eslint-skip -->\n<pre><code class=\"language-js\">{\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#worker_threads_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>"
        },
        {
          "textRaw": "`process.nextTick(callback[, ...args])`",
          "type": "method",
          "name": "nextTick",
          "meta": {
            "added": [
              "v0.1.26"
            ],
            "changes": [
              {
                "version": "v1.8.1",
                "pr-url": "https://github.com/nodejs/node/pull/1077",
                "description": "Additional arguments after `callback` are now supported."
              }
            ]
          },
          "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`"
                }
              ]
            }
          ],
          "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/docs/guides/event-loop-timers-and-nexttick/#process-nexttick\">Event Loop</a> guide for more background.</p>\n<pre><code class=\"language-js\">console.log('start');\nprocess.nextTick(() => {\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-js\">function MyThing(options) {\n  this.setupOptions(options);\n\n  process.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-js\">function definitelyAsync(arg, cb) {\n  if (arg) {\n    process.nextTick(cb);\n    return;\n  }\n\n  fs.stat('file', cb);\n}\n</code></pre>"
        },
        {
          "textRaw": "`process.resourceUsage()`",
          "type": "method",
          "name": "resourceUsage",
          "meta": {
            "added": [
              "v12.6.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "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][uv_rusage_t].",
                "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][uv_rusage_t].",
                "options": [
                  {
                    "textRaw": "`userCPUTime` {integer} maps to `ru_utime` computed in microseconds. It is the same value as [`process.cpuUsage().user`][process.cpuUsage].",
                    "name": "userCPUTime",
                    "type": "integer",
                    "desc": "maps to `ru_utime` computed in microseconds. It is the same value as [`process.cpuUsage().user`][process.cpuUsage]."
                  },
                  {
                    "textRaw": "`systemCPUTime` {integer} maps to `ru_stime` computed in microseconds. It is the same value as [`process.cpuUsage().system`][process.cpuUsage].",
                    "name": "systemCPUTime",
                    "type": "integer",
                    "desc": "maps to `ru_stime` computed in microseconds. It is the same value as [`process.cpuUsage().system`][process.cpuUsage]."
                  },
                  {
                    "textRaw": "`maxRSS` {integer} maps to `ru_maxrss` which is the maximum resident set size used in kilobytes.",
                    "name": "maxRSS",
                    "type": "integer",
                    "desc": "maps to `ru_maxrss` which is the maximum resident set size used in kilobytes."
                  },
                  {
                    "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][wikipedia_minor_fault].",
                    "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][wikipedia_minor_fault]."
                  },
                  {
                    "textRaw": "`majorPageFault` {integer} maps to `ru_majflt` which is the number of major page faults for the process, see [this article for more details][wikipedia_major_fault]. 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][wikipedia_major_fault]. 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."
                  }
                ]
              },
              "params": []
            }
          ],
          "desc": "<pre><code class=\"language-js\">console.log(process.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])`",
          "type": "method",
          "name": "send",
          "meta": {
            "added": [
              "v0.5.9"
            ],
            "changes": []
          },
          "signatures": [
            {
              "return": {
                "textRaw": "Returns: {boolean}",
                "name": "return",
                "type": "boolean"
              },
              "params": [
                {
                  "textRaw": "`message` {Object}",
                  "name": "message",
                  "type": "Object"
                },
                {
                  "textRaw": "`sendHandle` {net.Server|net.Socket}",
                  "name": "sendHandle",
                  "type": "net.Server|net.Socket"
                },
                {
                  "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."
                    }
                  ]
                },
                {
                  "textRaw": "`callback` {Function}",
                  "name": "callback",
                  "type": "Function"
                }
              ]
            }
          ],
          "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#child_process_event_message\"><code>'message'</code></a> event on the parent's <a href=\"child_process.html#child_process_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)`",
          "type": "method",
          "name": "setegid",
          "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-js\">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.log(`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#worker_threads_class_worker\"><code>Worker</code></a> threads.</p>"
        },
        {
          "textRaw": "`process.seteuid(id)`",
          "type": "method",
          "name": "seteuid",
          "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-js\">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.log(`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#worker_threads_class_worker\"><code>Worker</code></a> threads.</p>"
        },
        {
          "textRaw": "`process.setgid(id)`",
          "type": "method",
          "name": "setgid",
          "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-js\">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.log(`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#worker_threads_class_worker\"><code>Worker</code></a> threads.</p>"
        },
        {
          "textRaw": "`process.setgroups(groups)`",
          "type": "method",
          "name": "setgroups",
          "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<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#worker_threads_class_worker\"><code>Worker</code></a> threads.</p>"
        },
        {
          "textRaw": "`process.setuid(id)`",
          "type": "method",
          "name": "setuid",
          "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-js\">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.log(`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#worker_threads_class_worker\"><code>Worker</code></a> threads.</p>"
        },
        {
          "textRaw": "`process.setUncaughtExceptionCaptureCallback(fn)`",
          "type": "method",
          "name": "setUncaughtExceptionCaptureCallback",
          "meta": {
            "added": [
              "v9.3.0"
            ],
            "changes": []
          },
          "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=\"process.html#process_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#v8_v8_setflagsfromstring_flags\"><code>v8.setFlagsFromString()</code></a>, the process will\nnot abort.</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>Using this function is mutually exclusive with using the deprecated\n<a href=\"domain.html\"><code>domain</code></a> built-in module.</p>"
        },
        {
          "textRaw": "`process.umask([mask])`",
          "type": "method",
          "name": "umask",
          "meta": {
            "added": [
              "v0.1.19"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`mask` {string|integer}",
                  "name": "mask",
                  "type": "string|integer"
                }
              ]
            }
          ],
          "desc": "<p>The <code>process.umask()</code> method sets or returns the Node.js process's file mode\ncreation mask. Child processes inherit the mask from the parent process. Invoked\nwithout an argument, the current mask is returned, otherwise the umask is set to\nthe argument value and the previous mask is returned.</p>\n<pre><code class=\"language-js\">const newmask = 0o022;\nconst oldmask = process.umask(newmask);\nconsole.log(\n  `Changed umask from ${oldmask.toString(8)} to ${newmask.toString(8)}`\n);\n</code></pre>\n<p><a href=\"worker_threads.html#worker_threads_class_worker\"><code>Worker</code></a> threads are able to read the umask, however attempting to set the\numask will result in a thrown exception.</p>"
        },
        {
          "textRaw": "`process.uptime()`",
          "type": "method",
          "name": "uptime",
          "meta": {
            "added": [
              "v0.5.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "return": {
                "textRaw": "Returns: {number}",
                "name": "return",
                "type": "number"
              },
              "params": []
            }
          ],
          "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": "`allowedNodeEnvironmentFlags` {Set}",
          "type": "Set",
          "name": "allowedNodeEnvironmentFlags",
          "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#cli_node_options_options\"><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#cli_node_options_options\"><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-js\">process.allowedNodeEnvironmentFlags.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#cli_node_options_options\"><code>NODE_OPTIONS</code></a> support (shown in\n<a href=\"process.html#process_process_config\"><code>process.config</code></a>), <code>process.allowedNodeEnvironmentFlags</code> will\ncontain what <em>would have</em> been allowable.</p>"
        },
        {
          "textRaw": "`arch` {string}",
          "type": "string",
          "name": "arch",
          "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>'mips'</code>,<code>'mipsel'</code>, <code>'ppc'</code>,\n<code>'ppc64'</code>, <code>'s390'</code>, <code>'s390x'</code>, <code>'x32'</code>, and <code>'x64'</code>.</p>\n<pre><code class=\"language-js\">console.log(`This processor architecture is ${process.arch}`);\n</code></pre>"
        },
        {
          "textRaw": "`argv` {string[]}",
          "type": "string[]",
          "name": "argv",
          "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=\"process.html#process_process_execpath\"><code>process.execPath</code></a>. See <code>process.argv0</code> if access to the original value\nof <code>argv[0]</code> is needed. The second element will be the path to the JavaScript\nfile being executed. The remaining elements will be any 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-js\">// print process.argv\nprocess.argv.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-console\">$ 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": "`argv0` {string}",
          "type": "string",
          "name": "argv0",
          "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": "`channel` {Object}",
          "type": "Object",
          "name": "channel",
          "meta": {
            "added": [
              "v7.1.0"
            ],
            "changes": []
          },
          "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>"
        },
        {
          "textRaw": "`config` {Object}",
          "type": "Object",
          "name": "config",
          "meta": {
            "added": [
              "v0.7.7"
            ],
            "changes": []
          },
          "desc": "<p>The <code>process.config</code> property returns an <code>Object</code> containing the JavaScript\nrepresentation of the configure options used to compile the current Node.js\nexecutable. This is the same as the <code>config.gypi</code> file that was produced when\nrunning the <code>./configure</code> script.</p>\n<p>An example of the possible output looks like:</p>\n<!-- eslint-skip -->\n<pre><code class=\"language-js\">{\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_dtrace: 'false',\n     node_use_openssl: 'true',\n     node_shared_openssl: 'false',\n     strict_aliasing: 'true',\n     target_arch: 'x64',\n     v8_use_snapshot: 1\n   }\n}\n</code></pre>\n<p>The <code>process.config</code> property is <strong>not</strong> read-only and there are existing\nmodules in the ecosystem that are known to extend, modify, or entirely replace\nthe value of <code>process.config</code>.</p>"
        },
        {
          "textRaw": "`connected` {boolean}",
          "type": "boolean",
          "name": "connected",
          "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": "`debugPort` {number}",
          "type": "number",
          "name": "debugPort",
          "meta": {
            "added": [
              "v0.7.2"
            ],
            "changes": []
          },
          "desc": "<p>The port used by the Node.js debugger when enabled.</p>\n<pre><code class=\"language-js\">process.debugPort = 5858;\n</code></pre>"
        },
        {
          "textRaw": "`env` {Object}",
          "type": "Object",
          "name": "env",
          "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<!-- eslint-skip -->\n<pre><code class=\"language-js\">{\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#worker_threads_class_worker\"><code>Worker</code></a> threads.\nIn other words, the following example would not work:</p>\n<pre><code class=\"language-console\">$ 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-js\">process.env.foo = 'bar';\nconsole.log(process.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-js\">process.env.test = null;\nconsole.log(process.env.test);\n// => 'null'\nprocess.env.test = undefined;\nconsole.log(process.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-js\">process.env.TEST = 1;\ndelete process.env.TEST;\nconsole.log(process.env.TEST);\n// => undefined\n</code></pre>\n<p>On Windows operating systems, environment variables are case-insensitive.</p>\n<pre><code class=\"language-js\">process.env.TEST = 1;\nconsole.log(process.env.test);\n// => 1\n</code></pre>\n<p>Unless explicitly specified when creating a <a href=\"worker_threads.html#worker_threads_class_worker\"><code>Worker</code></a> instance,\neach <a href=\"worker_threads.html#worker_threads_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#worker_threads_class_worker\"><code>Worker</code></a> constructor. Changes to <code>process.env</code> will not be visible\nacross <a href=\"worker_threads.html#worker_threads_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.</p>"
        },
        {
          "textRaw": "`execArgv` {string[]}",
          "type": "string[]",
          "name": "execArgv",
          "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=\"process.html#process_process_argv\"><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-console\">$ node --harmony script.js --version\n</code></pre>\n<p>Results in <code>process.execArgv</code>:</p>\n<!-- eslint-disable semi -->\n<pre><code class=\"language-js\">['--harmony']\n</code></pre>\n<p>And <code>process.argv</code>:</p>\n<!-- eslint-disable semi -->\n<pre><code class=\"language-js\">['/usr/local/bin/node', 'script.js', '--version']\n</code></pre>"
        },
        {
          "textRaw": "`execPath` {string}",
          "type": "string",
          "name": "execPath",
          "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.</p>\n<!-- eslint-disable semi -->\n<pre><code class=\"language-js\">'/usr/local/bin/node'\n</code></pre>"
        },
        {
          "textRaw": "`exitCode` {integer}",
          "type": "integer",
          "name": "exitCode",
          "meta": {
            "added": [
              "v0.11.8"
            ],
            "changes": []
          },
          "desc": "<p>A number which will be the process exit code, when the process either\nexits gracefully, or is exited via <a href=\"process.html#process_process_exit_code\"><code>process.exit()</code></a> without specifying\na code.</p>\n<p>Specifying a code to <a href=\"process.html#process_process_exit_code\"><code>process.exit(code)</code></a> will override any\nprevious setting of <code>process.exitCode</code>.</p>"
        },
        {
          "textRaw": "`mainModule` {Object}",
          "type": "Object",
          "name": "mainModule",
          "meta": {
            "added": [
              "v0.1.17"
            ],
            "changes": []
          },
          "desc": "<p>The <code>process.mainModule</code> property provides an alternative way of retrieving\n<a href=\"modules.html#modules_accessing_the_main_module\"><code>require.main</code></a>. The difference is that if the main module changes at\nruntime, <a href=\"modules.html#modules_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#modules_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": "`noDeprecation` {boolean}",
          "type": "boolean",
          "name": "noDeprecation",
          "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=\"process.html#process_event_warning\"><code>'warning'</code> event</a> and the\n<a href=\"process.html#process_process_emitwarning_warning_type_code_ctor\"><code>emitWarning()</code> method</a> for more information about this\nflag's behavior.</p>"
        },
        {
          "textRaw": "`pid` {integer}",
          "type": "integer",
          "name": "pid",
          "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-js\">console.log(`This process is pid ${process.pid}`);\n</code></pre>"
        },
        {
          "textRaw": "`platform` {string}",
          "type": "string",
          "name": "platform",
          "meta": {
            "added": [
              "v0.1.16"
            ],
            "changes": []
          },
          "desc": "<p>The <code>process.platform</code> property returns a string identifying the operating\nsystem platform on which the Node.js process is running.</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-js\">console.log(`This platform is ${process.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/master/BUILDING.md#androidandroid-based-devices-eg-firefox-os\">is experimental</a>.</p>"
        },
        {
          "textRaw": "`ppid` {integer}",
          "type": "integer",
          "name": "ppid",
          "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 current parent process.</p>\n<pre><code class=\"language-js\">console.log(`The parent process is pid ${process.ppid}`);\n</code></pre>"
        },
        {
          "textRaw": "`release` {Object}",
          "type": "Object",
          "name": "release",
          "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/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string&gt;</a> A value that will always be <code>'node'</code> for Node.js. For\nlegacy io.js releases, this will be <code>'io.js'</code>.</li>\n<li><code>sourceUrl</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string&gt;</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/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string&gt;</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/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string&gt;</a> an absolute URL pointing to a <em><code>node.lib</code></em> file matching the\narchitecture and version of the current release. This file is used for\ncompiling Node.js native add-ons. <em>This property is only present on Windows\nbuilds of Node.js and will be missing on all other platforms.</em></li>\n<li>\n<p><code>lts</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string&gt;</a> a string label identifying the <a href=\"https://github.com/nodejs/Release\">LTS</a> label for this release.\nThis property only exists for LTS releases and is <code>undefined</code> for all other\nrelease types, including <em>Current</em> releases. Currently the valid values are:</p>\n<ul>\n<li><code>'Argon'</code> for the 4.x LTS line beginning with 4.2.0.</li>\n<li><code>'Boron'</code> for the 6.x LTS line beginning with 6.9.0.</li>\n<li><code>'Carbon'</code> for the 8.x LTS line beginning with 8.9.1.</li>\n</ul>\n</li>\n</ul>\n<!-- eslint-skip -->\n<pre><code class=\"language-js\">{\n  name: 'node',\n  lts: 'Argon',\n  sourceUrl: 'https://nodejs.org/download/release/v4.4.5/node-v4.4.5.tar.gz',\n  headersUrl: 'https://nodejs.org/download/release/v4.4.5/node-v4.4.5-headers.tar.gz',\n  libUrl: 'https://nodejs.org/download/release/v4.4.5/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": "`report` {Object}",
          "type": "Object",
          "name": "report",
          "meta": {
            "added": [
              "v11.8.0"
            ],
            "changes": [
              {
                "version": "v12.17.0",
                "pr-url": "https://github.com/nodejs/node/pull/32242",
                "description": "This API is no longer considered 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": "`compact` {boolean}",
              "type": "boolean",
              "name": "compact",
              "meta": {
                "added": [
                  "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-js\">console.log(`Reports are compact? ${process.report.compact}`);\n</code></pre>"
            },
            {
              "textRaw": "`directory` {string}",
              "type": "string",
              "name": "directory",
              "meta": {
                "added": [
                  "v11.12.0"
                ],
                "changes": [
                  {
                    "version": "v12.17.0",
                    "pr-url": "https://github.com/nodejs/node/pull/32242",
                    "description": "This API is no longer considered 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-js\">console.log(`Report directory is ${process.report.directory}`);\n</code></pre>"
            },
            {
              "textRaw": "`filename` {string}",
              "type": "string",
              "name": "filename",
              "meta": {
                "added": [
                  "v11.12.0"
                ],
                "changes": [
                  {
                    "version": "v12.17.0",
                    "pr-url": "https://github.com/nodejs/node/pull/32242",
                    "description": "This API is no longer considered 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<pre><code class=\"language-js\">console.log(`Report filename is ${process.report.filename}`);\n</code></pre>"
            },
            {
              "textRaw": "`reportOnFatalError` {boolean}",
              "type": "boolean",
              "name": "reportOnFatalError",
              "meta": {
                "added": [
                  "v11.12.0"
                ],
                "changes": []
              },
              "stability": 1,
              "stabilityText": "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-js\">console.log(`Report on fatal error: ${process.report.reportOnFatalError}`);\n</code></pre>"
            },
            {
              "textRaw": "`reportOnSignal` {boolean}",
              "type": "boolean",
              "name": "reportOnSignal",
              "meta": {
                "added": [
                  "v11.12.0"
                ],
                "changes": [
                  {
                    "version": "v12.17.0",
                    "pr-url": "https://github.com/nodejs/node/pull/32242",
                    "description": "This API is no longer considered 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-js\">console.log(`Report on signal: ${process.report.reportOnSignal}`);\n</code></pre>"
            },
            {
              "textRaw": "`reportOnUncaughtException` {boolean}",
              "type": "boolean",
              "name": "reportOnUncaughtException",
              "meta": {
                "added": [
                  "v11.12.0"
                ],
                "changes": [
                  {
                    "version": "v12.17.0",
                    "pr-url": "https://github.com/nodejs/node/pull/32242",
                    "description": "This API is no longer considered experimental."
                  }
                ]
              },
              "desc": "<p>If <code>true</code>, a diagnostic report is generated on uncaught exception.</p>\n<pre><code class=\"language-js\">console.log(`Report on exception: ${process.report.reportOnUncaughtException}`);\n</code></pre>"
            },
            {
              "textRaw": "`signal` {string}",
              "type": "string",
              "name": "signal",
              "meta": {
                "added": [
                  "v11.12.0"
                ],
                "changes": [
                  {
                    "version": "v12.17.0",
                    "pr-url": "https://github.com/nodejs/node/pull/32242",
                    "description": "This API is no longer considered 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-js\">console.log(`Report signal: ${process.report.signal}`);\n</code></pre>"
            }
          ],
          "methods": [
            {
              "textRaw": "`process.report.getReport([err])`",
              "type": "method",
              "name": "getReport",
              "meta": {
                "added": [
                  "v11.8.0"
                ],
                "changes": [
                  {
                    "version": "v12.17.0",
                    "pr-url": "https://github.com/nodejs/node/pull/32242",
                    "description": "This API is no longer considered experimental."
                  }
                ]
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Object}",
                    "name": "return",
                    "type": "Object"
                  },
                  "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."
                    }
                  ]
                }
              ],
              "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-js\">const data = process.report.getReport();\nconsole.log(data.header.nodeJsVersion);\n\n// Similar to process.report.writeReport()\nconst fs = require('fs');\nfs.writeFileSync(util.inspect(data), 'my-report.log', '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])`",
              "type": "method",
              "name": "writeReport",
              "meta": {
                "added": [
                  "v11.8.0"
                ],
                "changes": [
                  {
                    "version": "v12.17.0",
                    "pr-url": "https://github.com/nodejs/node/pull/32242",
                    "description": "This API is no longer considered experimental."
                  }
                ]
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {string} Returns the filename of the generated report.",
                    "name": "return",
                    "type": "string",
                    "desc": "Returns the filename of the generated report."
                  },
                  "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."
                    },
                    {
                      "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."
                    }
                  ]
                }
              ],
              "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<pre><code class=\"language-js\">process.report.writeReport();\n</code></pre>\n<p>Additional documentation is available in the <a href=\"report.html\">report documentation</a>.</p>"
            }
          ]
        },
        {
          "textRaw": "`stderr` {Stream}",
          "type": "Stream",
          "name": "stderr",
          "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#net_class_net_socket\"><code>net.Socket</code></a> (which is a <a href=\"stream.html#stream_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#stream_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=\"process.html#process_a_note_on_process_i_o\">note on process I/O</a> for more information.</p>",
          "properties": [
            {
              "textRaw": "`fd` {number}",
              "type": "number",
              "name": "fd",
              "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#worker_threads_class_worker\"><code>Worker</code></a> threads,\nthis field does not exist.</p>"
            }
          ]
        },
        {
          "textRaw": "`stdin` {Stream}",
          "type": "Stream",
          "name": "stdin",
          "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#net_class_net_socket\"><code>net.Socket</code></a> (which is a <a href=\"stream.html#stream_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#stream_readable_streams\">Readable</a> stream.</p>\n<pre><code class=\"language-js\">process.stdin.setEncoding('utf8');\n\nprocess.stdin.on('readable', () => {\n  let chunk;\n  // Use a loop to make sure we read all available data.\n  while ((chunk = process.stdin.read()) !== null) {\n    process.stdout.write(`data: ${chunk}`);\n  }\n});\n\nprocess.stdin.on('end', () => {\n  process.stdout.write('end');\n});\n</code></pre>\n<p>As a <a href=\"stream.html#stream_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#stream_compatibility_with_older_node_js_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": "`fd` {number}",
              "type": "number",
              "name": "fd",
              "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#worker_threads_class_worker\"><code>Worker</code></a> threads,\nthis field does not exist.</p>"
            }
          ]
        },
        {
          "textRaw": "`stdout` {Stream}",
          "type": "Stream",
          "name": "stdout",
          "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#net_class_net_socket\"><code>net.Socket</code></a> (which is a <a href=\"stream.html#stream_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#stream_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-js\">process.stdin.pipe(process.stdout);\n</code></pre>\n<p><code>process.stdout</code> differs from other Node.js streams in important ways. See\n<a href=\"process.html#process_a_note_on_process_i_o\">note on process I/O</a> for more information.</p>",
          "properties": [
            {
              "textRaw": "`fd` {number}",
              "type": "number",
              "name": "fd",
              "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#worker_threads_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",
              "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#console_console_log_data_args\"><code>console.log()</code></a> and <a href=\"console.html#console_console_error_data_args\"><code>console.error()</code></a>,\nrespectively.</li>\n<li>\n<p>Writes may be synchronous depending on what the stream is connected to\nand whether the system is Windows or POSIX:</p>\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 backwards 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=\"process.html#process_process_exit_code\"><code>process.exit()</code></a> for more information.</p>\n<p><strong><em>Warning</em></strong>: 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, its 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\">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\">TTY</a> documentation for more information.</p>",
              "type": "module",
              "displayName": "A note on process I/O"
            }
          ]
        },
        {
          "textRaw": "`throwDeprecation` {boolean}",
          "type": "boolean",
          "name": "throwDeprecation",
          "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=\"process.html#process_event_warning\"><code>'warning'</code> event</a> and the\n<a href=\"process.html#process_process_emitwarning_warning_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": "`title` {string}",
          "type": "string",
          "name": "title",
          "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 v0.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>"
        },
        {
          "textRaw": "`traceDeprecation` {boolean}",
          "type": "boolean",
          "name": "traceDeprecation",
          "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=\"process.html#process_event_warning\"><code>'warning'</code> event</a> and the\n<a href=\"process.html#process_process_emitwarning_warning_type_code_ctor\"><code>emitWarning()</code> method</a> for more information about this\nflag's behavior.</p>"
        },
        {
          "textRaw": "`version` {string}",
          "type": "string",
          "name": "version",
          "meta": {
            "added": [
              "v0.1.3"
            ],
            "changes": []
          },
          "desc": "<p>The <code>process.version</code> property returns the Node.js version string.</p>\n<pre><code class=\"language-js\">console.log(`Version: ${process.version}`);\n</code></pre>"
        },
        {
          "textRaw": "`versions` {Object}",
          "type": "Object",
          "name": "versions",
          "meta": {
            "added": [
              "v0.2.0"
            ],
            "changes": [
              {
                "version": "v4.2.0",
                "pr-url": "https://github.com/nodejs/node/pull/3102",
                "description": "The `icu` property is now supported."
              },
              {
                "version": "v9.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/15785",
                "description": "The `v8` property now includes a Node.js specific suffix."
              }
            ]
          },
          "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-js\">console.log(process.versions);\n</code></pre>\n<p>Will generate an object similar to:</p>\n<pre><code class=\"language-console\">{ node: '11.13.0',\n  v8: '7.0.276.38-node.18',\n  uv: '1.27.0',\n  zlib: '1.2.11',\n  brotli: '1.0.7',\n  ares: '1.15.0',\n  modules: '67',\n  nghttp2: '1.34.0',\n  napi: '4',\n  llhttp: '1.1.1',\n  http_parser: '2.8.0',\n  openssl: '1.1.1b',\n  cldr: '34.0',\n  icu: '63.1',\n  tz: '2018e',\n  unicode: '11.0' }\n</code></pre>"
        }
      ]
    }
  ],
  "methods": [
    {
      "textRaw": "`require()`",
      "type": "method",
      "name": "require",
      "signatures": [
        {
          "params": []
        }
      ],
      "desc": "<p>This variable may appear to be global but is not. See <a href=\"modules.html#modules_require_id\"><code>require()</code></a>.</p>"
    }
  ]
}