Server IP : 192.168.23.10  /  Your IP : 216.73.216.165
Web Server : Apache
System : Linux echo.premieradvertising.com 5.14.0-362.8.1.el9_3.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Nov 7 14:54:22 EST 2023 x86_64
User : rrrallyteam ( 1049)
PHP Version : 8.1.32
Disable Function : exec,passthru,shell_exec,system
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF
Directory (0755) :  /home/../usr/share/doc/libasyncns/../perl-Unicode-Normalize/../LibRaw/../nodejs/html/api/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/../usr/share/doc/libasyncns/../perl-Unicode-Normalize/../LibRaw/../nodejs/html/api/esm.json
{
  "type": "module",
  "source": "doc/api/esm.md",
  "introduced_in": "v8.5.0",
  "meta": {
    "added": [
      "v8.5.0"
    ],
    "changes": [
      {
        "version": [
          "v16.17.0"
        ],
        "pr-url": "https://github.com/nodejs/node/pull/42623",
        "description": "Add support for chaining loaders."
      },
      {
        "version": [
          "v16.14.0"
        ],
        "pr-url": "https://github.com/nodejs/node/pull/40250",
        "description": "Add support for import assertions."
      },
      {
        "version": [
          "v16.12.0"
        ],
        "pr-url": "https://github.com/nodejs/node/pull/37468",
        "description": "Consolidate loader hooks, removed `getFormat`, `getSource`, `transformSource`, and `getGlobalPreloadCode` hooks added `load` and `globalPreload` hooks allowed returning `format` from either `resolve` or `load` hooks."
      },
      {
        "version": [
          "v15.3.0",
          "v12.22.0"
        ],
        "pr-url": "https://github.com/nodejs/node/pull/35781",
        "description": "Stabilize modules implementation."
      },
      {
        "version": [
          "v14.13.0",
          "v12.20.0"
        ],
        "pr-url": "https://github.com/nodejs/node/pull/35249",
        "description": "Support for detection of CommonJS named exports."
      },
      {
        "version": "v14.8.0",
        "pr-url": "https://github.com/nodejs/node/pull/34558",
        "description": "Unflag Top-Level Await."
      },
      {
        "version": [
          "v14.0.0",
          "v13.14.0",
          "v12.20.0"
        ],
        "pr-url": "https://github.com/nodejs/node/pull/31974",
        "description": "Remove experimental modules warning."
      },
      {
        "version": [
          "v13.2.0",
          "v12.17.0"
        ],
        "pr-url": "https://github.com/nodejs/node/pull/29866",
        "description": "Loading ECMAScript modules no longer requires a command-line flag."
      },
      {
        "version": "v12.0.0",
        "pr-url": "https://github.com/nodejs/node/pull/26745",
        "description": "Add support for ES modules using `.js` file extension via `package.json` `\"type\"` field."
      }
    ]
  },
  "stability": 2,
  "stabilityText": "Stable",
  "properties": [
    {
      "textRaw": "`meta` {Object}",
      "type": "Object",
      "name": "meta",
      "desc": "<p>The <code>import.meta</code> meta property is an <code>Object</code> that contains the following\nproperties.</p>",
      "properties": [
        {
          "textRaw": "`url` {string} The absolute `file:` URL of the module.",
          "type": "string",
          "name": "url",
          "desc": "<p>This is defined exactly the same as it is in browsers providing the URL of the\ncurrent module file.</p>\n<p>This enables useful patterns such as relative file loading:</p>\n<pre><code class=\"language-js\">import { readFileSync } from 'node:fs';\nconst buffer = readFileSync(new URL('./data.proto', import.meta.url));\n</code></pre>",
          "shortDesc": "The absolute `file:` URL of the module."
        }
      ],
      "methods": [
        {
          "textRaw": "`import.meta.resolve(specifier[, parent])`",
          "type": "method",
          "name": "resolve",
          "signatures": [
            {
              "params": []
            }
          ],
          "desc": "<!--\nadded:\n  - v13.9.0\n  - v12.16.2\nchanges:\n  - version: v16.2.0\n    pr-url: https://github.com/nodejs/node/pull/38587\n    description: Add support for WHATWG `URL` object to `parentURL` parameter.\n-->\n<blockquote>\n<p>Stability: 1 - Experimental</p>\n</blockquote>\n<p>This feature is only available with the <code>--experimental-import-meta-resolve</code>\ncommand flag enabled.</p>\n<ul>\n<li><code>specifier</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string&gt;</a> The module specifier to resolve relative to <code>parent</code>.</li>\n<li><code>parent</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string&gt;</a> | <a href=\"url.html#the-whatwg-url-api\" class=\"type\">&lt;URL&gt;</a> The absolute parent module URL to resolve from. If none\nis specified, the value of <code>import.meta.url</code> is used as the default.</li>\n<li>Returns: <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise\" class=\"type\">&lt;Promise&gt;</a></li>\n</ul>\n<p>Provides a module-relative resolution function scoped to each module, returning\nthe URL string.</p>\n<!-- eslint-skip -->\n<pre><code class=\"language-js\">const dependencyAsset = await import.meta.resolve('component-lib/asset.css');\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<!-- eslint-skip -->\n<pre><code class=\"language-js\">await import.meta.resolve('./dep', import.meta.url);\n</code></pre>\n<p>This function is asynchronous because the ES module resolver in Node.js is\nallowed to be asynchronous.</p>"
        }
      ]
    }
  ],
  "miscs": [
    {
      "textRaw": "Modules: ECMAScript modules",
      "name": "Modules: ECMAScript modules",
      "introduced_in": "v8.5.0",
      "type": "misc",
      "meta": {
        "added": [
          "v8.5.0"
        ],
        "changes": [
          {
            "version": [
              "v16.17.0"
            ],
            "pr-url": "https://github.com/nodejs/node/pull/42623",
            "description": "Add support for chaining loaders."
          },
          {
            "version": [
              "v16.14.0"
            ],
            "pr-url": "https://github.com/nodejs/node/pull/40250",
            "description": "Add support for import assertions."
          },
          {
            "version": [
              "v16.12.0"
            ],
            "pr-url": "https://github.com/nodejs/node/pull/37468",
            "description": "Consolidate loader hooks, removed `getFormat`, `getSource`, `transformSource`, and `getGlobalPreloadCode` hooks added `load` and `globalPreload` hooks allowed returning `format` from either `resolve` or `load` hooks."
          },
          {
            "version": [
              "v15.3.0",
              "v12.22.0"
            ],
            "pr-url": "https://github.com/nodejs/node/pull/35781",
            "description": "Stabilize modules implementation."
          },
          {
            "version": [
              "v14.13.0",
              "v12.20.0"
            ],
            "pr-url": "https://github.com/nodejs/node/pull/35249",
            "description": "Support for detection of CommonJS named exports."
          },
          {
            "version": "v14.8.0",
            "pr-url": "https://github.com/nodejs/node/pull/34558",
            "description": "Unflag Top-Level Await."
          },
          {
            "version": [
              "v14.0.0",
              "v13.14.0",
              "v12.20.0"
            ],
            "pr-url": "https://github.com/nodejs/node/pull/31974",
            "description": "Remove experimental modules warning."
          },
          {
            "version": [
              "v13.2.0",
              "v12.17.0"
            ],
            "pr-url": "https://github.com/nodejs/node/pull/29866",
            "description": "Loading ECMAScript modules no longer requires a command-line flag."
          },
          {
            "version": "v12.0.0",
            "pr-url": "https://github.com/nodejs/node/pull/26745",
            "description": "Add support for ES modules using `.js` file extension via `package.json` `\"type\"` field."
          }
        ]
      },
      "stability": 2,
      "stabilityText": "Stable",
      "miscs": [
        {
          "textRaw": "Introduction",
          "name": "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 interoperability between them and its original module format,\n<a href=\"modules.html\">CommonJS</a>.</p>\n<!-- Anchors to make sure old links find a target -->\n<p><i id=\"esm_package_json_type_field\"></i><i id=\"esm_package_scope_and_file_extensions\"></i><i id=\"esm_input_type_flag\"></i></p>",
          "type": "misc",
          "displayName": "esm"
        },
        {
          "textRaw": "Enabling",
          "name": "Enabling",
          "type": "misc",
          "desc": "<p>Node.js has two module systems: <a href=\"modules.html\">CommonJS</a> modules and ECMAScript modules.</p>\n<p>Authors can tell Node.js to use the ECMAScript modules loader\nvia the <code>.mjs</code> file extension, the <code>package.json</code> <a href=\"packages.html#type\"><code>\"type\"</code></a> field, or the\n<a href=\"cli.html#--input-typetype\"><code>--input-type</code></a> flag. Outside of those cases, Node.js will use the CommonJS\nmodule loader. See <a href=\"packages.html#determining-module-system\">Determining module system</a> for more details.</p>\n<!-- Anchors to make sure old links find a target -->\n<p><i id=\"esm_package_entry_points\"></i><i id=\"esm_main_entry_point_export\"></i><i id=\"esm_subpath_exports\"></i><i id=\"esm_package_exports_fallbacks\"></i><i id=\"esm_exports_sugar\"></i><i id=\"esm_conditional_exports\"></i><i id=\"esm_nested_conditions\"></i><i id=\"esm_self_referencing_a_package_using_its_name\"></i><i id=\"esm_internal_package_imports\"></i><i id=\"esm_dual_commonjs_es_module_packages\"></i><i id=\"esm_dual_package_hazard\"></i><i id=\"esm_writing_dual_packages_while_avoiding_or_minimizing_hazards\"></i><i id=\"esm_approach_1_use_an_es_module_wrapper\"></i><i id=\"esm_approach_2_isolate_state\"></i></p>"
        },
        {
          "textRaw": "Packages",
          "name": "packages",
          "desc": "<p>This section was moved to <a href=\"packages.html\">Modules: Packages</a>.</p>",
          "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>'node:path'</code> in <code>import { sep } from 'node:path'</code>. Specifiers are also\nused in <code>export from</code> statements, and as the argument to an <code>import()</code>\nexpression.</p>\n<p>There are three types of specifiers:</p>\n<ul>\n<li>\n<p><em>Relative specifiers</em> like <code>'./startup.js'</code> or <code>'../config.mjs'</code>. They refer\nto a path relative to the location of the importing file. <em>The file extension\nis always necessary for these.</em></p>\n</li>\n<li>\n<p><em>Bare specifiers</em> like <code>'some-package'</code> or <code>'some-package/shuffle'</code>. They can\nrefer to the main entry point of a package by the package name, or a\nspecific feature module within a package prefixed by the package name as per\nthe examples respectively. <em>Including the file extension is only necessary\nfor packages without an <a href=\"packages.html#exports\"><code>\"exports\"</code></a> field.</em></p>\n</li>\n<li>\n<p><em>Absolute specifiers</em> like <code>'file:///opt/nodejs/config.js'</code>. They refer\ndirectly and explicitly to a full path.</p>\n</li>\n</ul>\n<p>Bare specifier resolutions are handled by the <a href=\"#resolver-algorithm-specification\">Node.js module resolution\nalgorithm</a>. All other specifier resolutions are always only resolved with\nthe standard relative <a href=\"https://url.spec.whatwg.org/\">URL</a> resolution semantics.</p>\n<p>Like in CommonJS, module files within packages can be accessed by appending a\npath to the package name unless the package's <a href=\"packages.html#nodejs-packagejson-field-definitions\"><code>package.json</code></a> contains an\n<a href=\"packages.html#exports\"><code>\"exports\"</code></a> field, in which case files within packages can only be accessed\nvia the paths defined in <a href=\"packages.html#exports\"><code>\"exports\"</code></a>.</p>\n<p>For details on these package resolution rules that apply to bare specifiers in\nthe Node.js module resolution, see the <a href=\"packages.html\">packages documentation</a>.</p>",
              "type": "module",
              "displayName": "Terminology"
            },
            {
              "textRaw": "Mandatory file extensions",
              "name": "mandatory_file_extensions",
              "desc": "<p>A file extension must be provided when using the <code>import</code> keyword to resolve\nrelative or absolute specifiers. Directory indexes (e.g. <code>'./startup/index.js'</code>)\nmust also be fully specified.</p>\n<p>This behavior matches how <code>import</code> behaves in browser environments, assuming a\ntypically configured server.</p>",
              "type": "module",
              "displayName": "Mandatory file extensions"
            },
            {
              "textRaw": "URLs",
              "name": "urls",
              "desc": "<p>ES modules are resolved and cached as URLs. This means that special characters\nmust be <a href=\"url.html#percent-encoding-in-urls\">percent-encoded</a>, such as <code>#</code> with <code>%23</code> and <code>?</code> with <code>%3F</code>.</p>\n<p><code>file:</code>, <code>node:</code>, and <code>data:</code> URL schemes are supported. A specifier like\n<code>'https://example.com/app.js'</code> is not supported natively in Node.js unless using\na <a href=\"#https-loader\">custom HTTPS loader</a>.</p>",
              "modules": [
                {
                  "textRaw": "`file:` URLs",
                  "name": "`file:`_urls",
                  "desc": "<p>Modules are loaded multiple times if the <code>import</code> specifier used to resolve\nthem has a different query or fragment.</p>\n<pre><code class=\"language-js\">import './foo.mjs?query=1'; // loads ./foo.mjs with query of \"?query=1\"\nimport './foo.mjs?query=2'; // loads ./foo.mjs with query of \"?query=2\"\n</code></pre>\n<p>The volume root may be referenced via <code>/</code>, <code>//</code>, or <code>file:///</code>. Given the\ndifferences between <a href=\"https://url.spec.whatwg.org/\">URL</a> and path resolution (such as percent encoding\ndetails), it is recommended to use <a href=\"url.html#urlpathtofileurlpath\">url.pathToFileURL</a> when importing a path.</p>",
                  "type": "module",
                  "displayName": "`file:` URLs"
                },
                {
                  "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<pre><code class=\"language-js\">import 'data:text/javascript,console.log(\"hello!\");';\nimport _ from 'data:application/json,\"world!\"' assert { type: 'json' };\n</code></pre>\n<p><code>data:</code> URLs only resolve <a href=\"#terminology\">bare specifiers</a> for builtin modules\nand <a href=\"#terminology\">absolute specifiers</a>. Resolving\n<a href=\"#terminology\">relative specifiers</a> does not work because <code>data:</code> is not a\n<a href=\"https://url.spec.whatwg.org/#special-scheme\">special scheme</a>. For example, attempting to load <code>./foo</code>\nfrom <code>data:text/javascript,import \"./foo\";</code> fails to resolve because there\nis no concept of relative resolution for <code>data:</code> URLs.</p>",
                  "type": "module",
                  "displayName": "`data:` imports"
                },
                {
                  "textRaw": "`node:` imports",
                  "name": "`node:`_imports",
                  "meta": {
                    "added": [
                      "v14.13.1",
                      "v12.20.0"
                    ],
                    "changes": [
                      {
                        "version": "v16.0.0",
                        "pr-url": "https://github.com/nodejs/node/pull/37246",
                        "description": "Added `node:` import support to `require(...)`."
                      }
                    ]
                  },
                  "desc": "<p><code>node:</code> URLs are supported as an alternative means to load Node.js builtin\nmodules. This URL scheme allows for builtin modules to be referenced by valid\nabsolute URL strings.</p>\n<pre><code class=\"language-js\">import fs from 'node:fs/promises';\n</code></pre>",
                  "type": "module",
                  "displayName": "`node:` imports"
                }
              ],
              "type": "module",
              "displayName": "URLs"
            }
          ],
          "type": "misc",
          "displayName": "`import` Specifiers"
        },
        {
          "textRaw": "Import assertions",
          "name": "import_assertions",
          "meta": {
            "added": [
              "v16.14.0"
            ],
            "changes": []
          },
          "stability": 1,
          "stabilityText": "Experimental",
          "desc": "<p>The <a href=\"https://github.com/tc39/proposal-import-assertions\">Import Assertions proposal</a> adds an inline syntax for module import\nstatements to pass on more information alongside the module specifier.</p>\n<pre><code class=\"language-js\">import fooData from './foo.json' assert { type: 'json' };\n\nconst { default: barData } =\n  await import('./bar.json', { assert: { type: 'json' } });\n</code></pre>\n<p>Node.js supports the following <code>type</code> values, for which the assertion is\nmandatory:</p>\n<table>\n<thead>\n<tr>\n<th>Assertion <code>type</code></th>\n<th>Needed for</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>'json'</code></td>\n<td><a href=\"#json-modules\">JSON modules</a></td>\n</tr>\n</tbody>\n</table>",
          "type": "misc",
          "displayName": "Import assertions"
        },
        {
          "textRaw": "Builtin modules",
          "name": "builtin_modules",
          "desc": "<p><a href=\"modules.html#core-modules\">Core modules</a> provide named exports of their public API. A\ndefault export is also provided which is the value of the CommonJS exports.\nThe default export can be used for, among other things, modifying the named\nexports. Named exports of builtin modules are updated only by calling\n<a href=\"module.html#modulesyncbuiltinesmexports\"><code>module.syncBuiltinESMExports()</code></a>.</p>\n<pre><code class=\"language-js\">import EventEmitter from 'node:events';\nconst e = new EventEmitter();\n</code></pre>\n<pre><code class=\"language-js\">import { readFile } from 'node:fs';\nreadFile('./foo.txt', (err, source) => {\n  if (err) {\n    console.error(err);\n  } else {\n    console.log(source);\n  }\n});\n</code></pre>\n<pre><code class=\"language-js\">import fs, { readFileSync } from 'node:fs';\nimport { syncBuiltinESMExports } from 'node:module';\nimport { Buffer } from 'node:buffer';\n\nfs.readFileSync = () => Buffer.from('Hello, ESM');\nsyncBuiltinESMExports();\n\nfs.readFileSync === readFileSync;\n</code></pre>",
          "type": "misc",
          "displayName": "Builtin modules"
        },
        {
          "textRaw": "`import()` expressions",
          "name": "`import()`_expressions",
          "desc": "<p><a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/import\">Dynamic <code>import()</code></a> is supported in both CommonJS and ES modules. In CommonJS\nmodules it can be used to load ES modules.</p>",
          "type": "misc",
          "displayName": "`import()` expressions"
        },
        {
          "textRaw": "Interoperability with CommonJS",
          "name": "interoperability_with_commonjs",
          "modules": [
            {
              "textRaw": "`import` statements",
              "name": "`import`_statements",
              "desc": "<p>An <code>import</code> statement can reference an ES module or a CommonJS module.\n<code>import</code> statements are permitted only in ES modules, but dynamic <a href=\"#import-expressions\"><code>import()</code></a>\nexpressions are supported in CommonJS for loading ES modules.</p>\n<p>When importing <a href=\"#commonjs-namespaces\">CommonJS modules</a>, the\n<code>module.exports</code> object is provided as the default export. Named exports may be\navailable, provided by static analysis as a convenience for better ecosystem\ncompatibility.</p>",
              "type": "module",
              "displayName": "`import` statements"
            },
            {
              "textRaw": "`require`",
              "name": "`require`",
              "desc": "<p>The CommonJS module <code>require</code> always treats the files it references as CommonJS.</p>\n<p>Using <code>require</code> to load an ES module is not supported because ES modules have\nasynchronous execution. Instead, use <a href=\"#import-expressions\"><code>import()</code></a> to load an ES module\nfrom a CommonJS module.</p>",
              "type": "module",
              "displayName": "`require`"
            },
            {
              "textRaw": "CommonJS Namespaces",
              "name": "commonjs_namespaces",
              "desc": "<p>CommonJS modules consist of a <code>module.exports</code> object which can be of any type.</p>\n<p>When importing a CommonJS module, it can be reliably imported using the ES\nmodule default import or its corresponding sugar syntax:</p>\n<!-- eslint-disable no-duplicate-imports -->\n<pre><code class=\"language-js\">import { default as cjs } from 'cjs';\n\n// The following import statement is \"syntax sugar\" (equivalent but sweeter)\n// for `{ default as cjsSugar }` in the above import statement:\nimport cjsSugar from 'cjs';\n\nconsole.log(cjs);\nconsole.log(cjs === cjsSugar);\n// Prints:\n//   &#x3C;module.exports>\n//   true\n</code></pre>\n<p>The ECMAScript Module Namespace representation of a CommonJS module is always\na namespace with a <code>default</code> export key pointing to the CommonJS\n<code>module.exports</code> value.</p>\n<p>This Module Namespace Exotic Object can be directly observed either when using\n<code>import * as m from 'cjs'</code> or a dynamic import:</p>\n<!-- eslint-skip -->\n<pre><code class=\"language-js\">import * as m from 'cjs';\nconsole.log(m);\nconsole.log(m === await import('cjs'));\n// Prints:\n//   [Module] { default: &#x3C;module.exports> }\n//   true\n</code></pre>\n<p>For better compatibility with existing usage in the JS ecosystem, Node.js\nin addition attempts to determine the CommonJS named exports of every imported\nCommonJS module to provide them as separate ES module exports using a static\nanalysis process.</p>\n<p>For example, consider a CommonJS module written:</p>\n<pre><code class=\"language-cjs\">// cjs.cjs\nexports.name = 'exported';\n</code></pre>\n<p>The preceding module supports named imports in ES modules:</p>\n<!-- eslint-disable no-duplicate-imports -->\n<pre><code class=\"language-js\">import { name } from './cjs.cjs';\nconsole.log(name);\n// Prints: 'exported'\n\nimport cjs from './cjs.cjs';\nconsole.log(cjs);\n// Prints: { name: 'exported' }\n\nimport * as m from './cjs.cjs';\nconsole.log(m);\n// Prints: [Module] { default: { name: 'exported' }, name: 'exported' }\n</code></pre>\n<p>As can be seen from the last example of the Module Namespace Exotic Object being\nlogged, the <code>name</code> export is copied off of the <code>module.exports</code> object and set\ndirectly on the ES module namespace when the module is imported.</p>\n<p>Live binding updates or new exports added to <code>module.exports</code> are not detected\nfor these named exports.</p>\n<p>The detection of named exports is based on common syntax patterns but does not\nalways correctly detect named exports. In these cases, using the default\nimport form described above can be a better option.</p>\n<p>Named exports detection covers many common export patterns, reexport patterns\nand build tool and transpiler outputs. See <a href=\"https://github.com/nodejs/cjs-module-lexer/tree/1.2.2\">cjs-module-lexer</a> for the exact\nsemantics implemented.</p>",
              "type": "module",
              "displayName": "CommonJS Namespaces"
            },
            {
              "textRaw": "Differences between ES modules and CommonJS",
              "name": "differences_between_es_modules_and_commonjs",
              "modules": [
                {
                  "textRaw": "No `require`, `exports`, or `module.exports`",
                  "name": "no_`require`,_`exports`,_or_`module.exports`",
                  "desc": "<p>In most cases, the ES module <code>import</code> can be used to load CommonJS modules.</p>\n<p>If needed, a <code>require</code> function can be constructed within an ES module using\n<a href=\"module.html#modulecreaterequirefilename\"><code>module.createRequire()</code></a>.</p>",
                  "type": "module",
                  "displayName": "No `require`, `exports`, or `module.exports`"
                },
                {
                  "textRaw": "No `__filename` or `__dirname`",
                  "name": "no_`__filename`_or_`__dirname`",
                  "desc": "<p>These CommonJS variables are not available in ES modules.</p>\n<p><code>__filename</code> and <code>__dirname</code> use cases can be replicated via\n<a href=\"#importmetaurl\"><code>import.meta.url</code></a>.</p>",
                  "type": "module",
                  "displayName": "No `__filename` or `__dirname`"
                },
                {
                  "textRaw": "No Native Module Loading",
                  "name": "no_native_module_loading",
                  "desc": "<p>Native modules are not currently supported with ES module imports.</p>\n<p>They can instead be loaded with <a href=\"module.html#modulecreaterequirefilename\"><code>module.createRequire()</code></a> or\n<a href=\"process.html#processdlopenmodule-filename-flags\"><code>process.dlopen</code></a>.</p>",
                  "type": "module",
                  "displayName": "No Native Module Loading"
                },
                {
                  "textRaw": "No `require.resolve`",
                  "name": "no_`require.resolve`",
                  "desc": "<p>Relative resolution can be handled via <code>new URL('./local', import.meta.url)</code>.</p>\n<p>For a complete <code>require.resolve</code> replacement, there is a flagged experimental\n<a href=\"#importmetaresolvespecifier-parent\"><code>import.meta.resolve</code></a> API.</p>\n<p>Alternatively <code>module.createRequire()</code> can be used.</p>",
                  "type": "module",
                  "displayName": "No `require.resolve`"
                },
                {
                  "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.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> as the ES module loader has its own\nseparate cache.</p>\n<p><i id=\"esm_experimental_json_modules\"></i></p>",
                  "type": "module",
                  "displayName": "No `require.cache`"
                }
              ],
              "type": "module",
              "displayName": "Differences between ES modules and CommonJS"
            }
          ],
          "type": "misc",
          "displayName": "Interoperability with CommonJS"
        },
        {
          "textRaw": "JSON modules",
          "name": "json_modules",
          "stability": 1,
          "stabilityText": "Experimental",
          "desc": "<p>JSON files can be referenced by <code>import</code>:</p>\n<pre><code class=\"language-js\">import packageConfig from './package.json' assert { type: 'json' };\n</code></pre>\n<p>The <code>assert { type: 'json' }</code> syntax is mandatory; see <a href=\"#import-assertions\">Import Assertions</a>.</p>\n<p>The imported JSON only exposes a <code>default</code> export. There is no support for named\nexports. A cache entry is created in the CommonJS cache to avoid duplication.\nThe same object is returned in CommonJS if the JSON module has already been\nimported from the same path.</p>\n<p><i id=\"esm_experimental_wasm_modules\"></i></p>",
          "type": "misc",
          "displayName": "JSON modules"
        },
        {
          "textRaw": "Wasm modules",
          "name": "wasm_modules",
          "stability": 1,
          "stabilityText": "Experimental",
          "desc": "<p>Importing WebAssembly 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 WebAssembly</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>\n<p><i id=\"esm_experimental_top_level_await\"></i></p>",
          "type": "misc",
          "displayName": "Wasm modules"
        },
        {
          "textRaw": "Top-level `await`",
          "name": "top-level_`await`",
          "meta": {
            "added": [
              "v14.8.0"
            ],
            "changes": []
          },
          "desc": "<p>The <code>await</code> keyword may be used in the top level body of an ECMAScript module.</p>\n<p>Assuming an <code>a.mjs</code> with</p>\n<pre><code class=\"language-js\">export const five = await Promise.resolve(5);\n</code></pre>\n<p>And a <code>b.mjs</code> with</p>\n<pre><code class=\"language-js\">import { five } from './a.mjs';\n\nconsole.log(five); // Logs `5`\n</code></pre>\n<pre><code class=\"language-bash\">node b.mjs # works\n</code></pre>\n<p>If a top level <code>await</code> expression never resolves, the <code>node</code> process will exit\nwith a <code>13</code> <a href=\"process.html#exit-codes\">status code</a>.</p>\n<pre><code class=\"language-js\">import { spawn } from 'node:child_process';\nimport { execPath } from 'node:process';\n\nspawn(execPath, [\n  '--input-type=module',\n  '--eval',\n  // Never-resolving Promise:\n  'await new Promise(() => {})',\n]).once('exit', (code) => {\n  console.log(code); // Logs `13`\n});\n</code></pre>",
          "type": "misc",
          "displayName": "Top-level `await`"
        },
        {
          "textRaw": "HTTPS and HTTP imports",
          "name": "https_and_http_imports",
          "stability": 1,
          "stabilityText": "Experimental",
          "desc": "<p>Importing network based modules using <code>https:</code> and <code>http:</code> is supported under\nthe <code>--experimental-network-imports</code> flag. This allows web browser-like imports\nto work in Node.js with a few differences due to application stability and\nsecurity concerns that are different when running in a privileged environment\ninstead of a browser sandbox.</p>",
          "modules": [
            {
              "textRaw": "Imports are limited to HTTP/1",
              "name": "imports_are_limited_to_http/1",
              "desc": "<p>Automatic protocol negotiation for HTTP/2 and HTTP/3 is not yet supported.</p>",
              "type": "module",
              "displayName": "Imports are limited to HTTP/1"
            },
            {
              "textRaw": "HTTP is limited to loopback addresses",
              "name": "http_is_limited_to_loopback_addresses",
              "desc": "<p><code>http:</code> is vulnerable to man-in-the-middle attacks and is not allowed to be\nused for addresses outside of the IPv4 address <code>127.0.0.0/8</code> (<code>127.0.0.1</code> to\n<code>127.255.255.255</code>) and the IPv6 address <code>::1</code>. Support for <code>http:</code> is intended\nto be used for local development.</p>",
              "type": "module",
              "displayName": "HTTP is limited to loopback addresses"
            },
            {
              "textRaw": "Authentication is never sent to the destination server.",
              "name": "authentication_is_never_sent_to_the_destination_server.",
              "desc": "<p><code>Authorization</code>, <code>Cookie</code>, and <code>Proxy-Authorization</code> headers are not sent to the\nserver. Avoid including user info in parts of imported URLs. A security model\nfor safely using these on the server is being worked on.</p>",
              "type": "module",
              "displayName": "Authentication is never sent to the destination server."
            },
            {
              "textRaw": "CORS is never checked on the destination server",
              "name": "cors_is_never_checked_on_the_destination_server",
              "desc": "<p>CORS is designed to allow a server to limit the consumers of an API to a\nspecific set of hosts. This is not supported as it does not make sense for a\nserver-based implementation.</p>",
              "type": "module",
              "displayName": "CORS is never checked on the destination server"
            },
            {
              "textRaw": "Cannot load non-network dependencies",
              "name": "cannot_load_non-network_dependencies",
              "desc": "<p>These modules cannot access other modules that are not over <code>http:</code> or <code>https:</code>.\nTo still access local modules while avoiding the security concern, pass in\nreferences to the local dependencies:</p>\n<pre><code class=\"language-mjs\">// file.mjs\nimport worker_threads from 'node:worker_threads';\nimport { configure, resize } from 'https://example.com/imagelib.mjs';\nconfigure({ worker_threads });\n</code></pre>\n<pre><code class=\"language-mjs\">// https://example.com/imagelib.mjs\nlet worker_threads;\nexport function configure(opts) {\n  worker_threads = opts.worker_threads;\n}\nexport function resize(img, size) {\n  // Perform resizing in worker_thread to avoid main thread blocking\n}\n</code></pre>",
              "type": "module",
              "displayName": "Cannot load non-network dependencies"
            },
            {
              "textRaw": "Network-based loading is not enabled by default",
              "name": "network-based_loading_is_not_enabled_by_default",
              "desc": "<p>For now, the <code>--experimental-network-imports</code> flag is required to enable loading\nresources over <code>http:</code> or <code>https:</code>. In the future, a different mechanism will be\nused to enforce this. Opt-in is required to prevent transitive dependencies\ninadvertently using potentially mutable state that could affect reliability\nof Node.js applications.</p>\n<p><i id=\"esm_experimental_loaders\"></i></p>",
              "type": "module",
              "displayName": "Network-based loading is not enabled by default"
            }
          ],
          "type": "misc",
          "displayName": "HTTPS and HTTP imports"
        },
        {
          "textRaw": "Loaders",
          "name": "Loaders",
          "meta": {
            "added": [
              "v8.8.0"
            ],
            "changes": [
              {
                "version": [
                  "v16.17.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/42623",
                "description": "Add support for chaining loaders."
              },
              {
                "version": "v16.12.0",
                "pr-url": "https://github.com/nodejs/node/pull/37468",
                "description": "Removed `getFormat`, `getSource`, `transformSource`, and `globalPreload`; added `load` hook and `getGlobalPreload` hook."
              }
            ]
          },
          "stability": 1,
          "stabilityText": "Experimental",
          "type": "misc",
          "desc": "<blockquote>\n<p>This API is currently being redesigned and will still change.</p>\n</blockquote>\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 apply to the entry point and all <code>import</code> calls. They\nwon't apply to <code>require</code> calls; those still follow <a href=\"modules.html\">CommonJS</a> rules.</p>\n<p>Loaders follow the pattern of <code>--require</code>:</p>\n<pre><code class=\"language-console\">node \\\n  --experimental-loader unpkg \\\n  --experimental-loader http-to-https \\\n  --experimental-loader cache-buster\n</code></pre>\n<p>These are called in the following sequence: <code>cache-buster</code> calls\n<code>http-to-https</code> which calls <code>unpkg</code>.</p>",
          "miscs": [
            {
              "textRaw": "Hooks",
              "name": "hooks",
              "desc": "<p>Hooks are part of a chain, even if that chain consists of only one custom\n(user-provided) hook and the default hook, which is always present. Hook\nfunctions nest: each one must always return a plain object, and chaining happens\nas a result of each function calling <code>next&#x3C;hookName>()</code>, which is a reference\nto the subsequent loader’s hook.</p>\n<p>A hook that returns a value lacking a required property triggers an exception.\nA hook that returns without calling <code>next&#x3C;hookName>()</code> <em>and</em> without returning\n<code>shortCircuit: true</code> also triggers an exception. These errors are to help\nprevent unintentional breaks in the chain.</p>",
              "methods": [
                {
                  "textRaw": "`resolve(specifier, context, nextResolve)`",
                  "type": "method",
                  "name": "resolve",
                  "meta": {
                    "changes": [
                      {
                        "version": [
                          "v16.17.0"
                        ],
                        "pr-url": "https://github.com/nodejs/node/pull/42623",
                        "description": "Add support for chaining resolve hooks. Each hook must either call `nextResolve()` or include a `shortCircuit` property set to `true` in its return."
                      },
                      {
                        "version": [
                          "v16.14.0"
                        ],
                        "pr-url": "https://github.com/nodejs/node/pull/40250",
                        "description": "Add support for import assertions."
                      }
                    ]
                  },
                  "signatures": [
                    {
                      "params": []
                    }
                  ],
                  "desc": "<blockquote>\n<p>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<ul>\n<li><code>specifier</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>context</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object\" class=\"type\">&lt;Object&gt;</a>\n<ul>\n<li><code>conditions</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string[]&gt;</a> Export conditions of the relevant <code>package.json</code></li>\n<li><code>importAssertions</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object\" class=\"type\">&lt;Object&gt;</a></li>\n<li><code>parentURL</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#Undefined_type\" class=\"type\">&lt;undefined&gt;</a> The module importing this one, or undefined\nif this is the Node.js entry point</li>\n</ul>\n</li>\n<li><code>nextResolve</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function\" class=\"type\">&lt;Function&gt;</a> The subsequent <code>resolve</code> hook in the chain, or the\nNode.js default <code>resolve</code> hook after the last user-supplied <code>resolve</code> hook\n<ul>\n<li><code>specifier</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string&gt;</a></li>\n<li><code>context</code> <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</li>\n<li>Returns: <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object\" class=\"type\">&lt;Object&gt;</a>\n<ul>\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> | <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Null_type\" class=\"type\">&lt;null&gt;</a> | <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Undefined_type\" class=\"type\">&lt;undefined&gt;</a> A hint to the load hook (it might be\nignored)\n<code>'builtin' | 'commonjs' | 'json' | 'module' | 'wasm'</code></li>\n<li><code>shortCircuit</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Undefined_type\" class=\"type\">&lt;undefined&gt;</a> | <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type\" class=\"type\">&lt;boolean&gt;</a> A signal that this hook intends to\nterminate the chain of <code>resolve</code> hooks. <strong>Default:</strong> <code>false</code></li>\n<li><code>url</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string&gt;</a> The absolute URL to which this input resolves</li>\n</ul>\n</li>\n</ul>\n<p>The <code>resolve</code> hook chain is responsible for resolving file URL for a given\nmodule specifier and parent URL, and optionally its format (such as <code>'module'</code>)\nas a hint to the <code>load</code> hook. If a format is specified, the <code>load</code> hook is\nultimately responsible for providing the final <code>format</code> value (and it is free to\nignore the hint provided by <code>resolve</code>); if <code>resolve</code> provides a <code>format</code>, a\ncustom <code>load</code> hook is required even if only to pass the value to the Node.js\ndefault <code>load</code> hook.</p>\n<p>The module specifier is the string in an <code>import</code> statement or\n<code>import()</code> expression.</p>\n<p>The parent URL is the URL of the module that imported this one, or <code>undefined</code>\nif this is the main entry point for the application.</p>\n<p>The <code>conditions</code> property in <code>context</code> is an array of conditions for\n<a href=\"packages.html#conditional-exports\">package exports conditions</a> that apply to this resolution\nrequest. They can be used for looking up conditional mappings elsewhere or to\nmodify the list when calling the default resolution logic.</p>\n<p>The current <a href=\"packages.html#conditional-exports\">package exports conditions</a> are always in\nthe <code>context.conditions</code> array passed into the hook. To guarantee <em>default\nNode.js module specifier resolution behavior</em> when calling <code>defaultResolve</code>, the\n<code>context.conditions</code> array passed to it <em>must</em> include <em>all</em> elements of the\n<code>context.conditions</code> array originally passed into the <code>resolve</code> hook.</p>\n<pre><code class=\"language-js\">export async function resolve(specifier, context, nextResolve) {\n  const { parentURL = null } = context;\n\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      shortCircuit: true,\n      url: parentURL ?\n        new URL(specifier, parentURL).href :\n        new URL(specifier).href,\n    };\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 nextResolve(specifier, {\n      ...context,\n      conditions: [...context.conditions, 'another-condition'],\n    });\n  }\n\n  // Defer to the next hook in the chain, which would be the\n  // Node.js default resolve if this is the last user-specified loader.\n  return nextResolve(specifier);\n}\n</code></pre>"
                },
                {
                  "textRaw": "`load(url, context, nextLoad)`",
                  "type": "method",
                  "name": "load",
                  "meta": {
                    "changes": [
                      {
                        "version": "v16.17.0",
                        "pr-url": "https://github.com/nodejs/node/pull/42623",
                        "description": "Add support for chaining load hooks. Each hook must either call `nextLoad()` or include a `shortCircuit` property set to `true` in its return."
                      }
                    ]
                  },
                  "signatures": [
                    {
                      "params": []
                    }
                  ],
                  "desc": "<blockquote>\n<p>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<blockquote>\n<p>In a previous version of this API, this was split across 3 separate, now\ndeprecated, hooks (<code>getFormat</code>, <code>getSource</code>, and <code>transformSource</code>).</p>\n</blockquote>\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 URL returned by the <code>resolve</code> chain</li>\n<li><code>context</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object\" class=\"type\">&lt;Object&gt;</a>\n<ul>\n<li><code>conditions</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string[]&gt;</a> Export conditions of the relevant <code>package.json</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> | <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Null_type\" class=\"type\">&lt;null&gt;</a> | <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Undefined_type\" class=\"type\">&lt;undefined&gt;</a> The format optionally supplied by the\n<code>resolve</code> hook chain</li>\n<li><code>importAssertions</code> <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</li>\n<li><code>nextLoad</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function\" class=\"type\">&lt;Function&gt;</a> The subsequent <code>load</code> hook in the chain, or the\nNode.js default <code>load</code> hook after the last user-supplied <code>load</code> hook\n<ul>\n<li><code>specifier</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>context</code> <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</li>\n<li>Returns: <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object\" class=\"type\">&lt;Object&gt;</a>\n<ul>\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></li>\n<li><code>shortCircuit</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Undefined_type\" class=\"type\">&lt;undefined&gt;</a> | <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type\" class=\"type\">&lt;boolean&gt;</a> A signal that this hook intends to\nterminate the chain of <code>resolve</code> hooks. <strong>Default:</strong> <code>false</code></li>\n<li><code>source</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/Reference/Global_Objects/ArrayBuffer\" class=\"type\">&lt;ArrayBuffer&gt;</a> | <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray\" class=\"type\">&lt;TypedArray&gt;</a> The source for Node.js to evaluate</li>\n</ul>\n</li>\n</ul>\n<p>The <code>load</code> hook provides a way to define a custom method of determining how\na URL should be interpreted, retrieved, and parsed. It is also in charge of\nvalidating the import assertion.</p>\n<p>The final value of <code>format</code> must be one of the following:</p>\n<table>\n<thead>\n<tr>\n<th><code>format</code></th>\n<th>Description</th>\n<th>Acceptable types for <code>source</code> returned by <code>load</code></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>'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>'json'</code></td>\n<td>Load a JSON file</td>\n<td>{ <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String\"><code>string</code></a>, <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer\"><code>ArrayBuffer</code></a>, <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray\"><code>TypedArray</code></a> }</td>\n</tr>\n<tr>\n<td><code>'module'</code></td>\n<td>Load an ES module</td>\n<td>{ <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String\"><code>string</code></a>, <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer\"><code>ArrayBuffer</code></a>, <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray\"><code>TypedArray</code></a> }</td>\n</tr>\n<tr>\n<td><code>'wasm'</code></td>\n<td>Load a WebAssembly module</td>\n<td>{ <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer\"><code>ArrayBuffer</code></a>, <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray\"><code>TypedArray</code></a> }</td>\n</tr>\n</tbody>\n</table>\n<p>The value of <code>source</code> is ignored for type <code>'builtin'</code> because currently it is\nnot possible to replace the value of a Node.js builtin (core) module. The value\nof <code>source</code> is ignored for type <code>'commonjs'</code> because the CommonJS module loader\ndoes not provide a mechanism for the ES module loader to override the\n<a href=\"#commonjs-namespaces\">CommonJS module return value</a>. This limitation might be\novercome in the future.</p>\n<blockquote>\n<p><strong>Caveat</strong>: The ESM <code>load</code> hook and namespaced exports from CommonJS modules\nare incompatible. Attempting to use them together will result in an empty\nobject from the import. This may be addressed in the future.</p>\n</blockquote>\n<blockquote>\n<p>These types all correspond to classes defined in ECMAScript.</p>\n</blockquote>\n<ul>\n<li>The specific <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer\"><code>ArrayBuffer</code></a> object is a <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer\"><code>SharedArrayBuffer</code></a>.</li>\n<li>The specific <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray\"><code>TypedArray</code></a> object is a <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array\"><code>Uint8Array</code></a>.</li>\n</ul>\n<p>If the source value of a text-based format (i.e., <code>'json'</code>, <code>'module'</code>)\nis not a string, it is converted to a string using <a href=\"util.html#class-utiltextdecoder\"><code>util.TextDecoder</code></a>.</p>\n<p>The <code>load</code> hook provides a way to define a custom method for retrieving the\nsource code of an ES module specifier. This would allow a loader to potentially\navoid reading files from disk. It could also be used to map an unrecognized\nformat to a supported one, for example <code>yaml</code> to <code>module</code>.</p>\n<pre><code class=\"language-js\">export async function load(url, context, nextLoad) {\n  const { format } = context;\n\n  if (Math.random() > 0.5) { // Some condition\n    /*\n      For some or all URLs, do some custom logic for retrieving the source.\n      Always return an object of the form {\n        format: &#x3C;string>,\n        source: &#x3C;string|buffer>,\n      }.\n    */\n    return {\n      format,\n      shortCircuit: true,\n      source: '...',\n    };\n  }\n\n  // Defer to the next hook in the chain.\n  return nextLoad(url);\n}\n</code></pre>\n<p>In a more advanced scenario, this can also be used to transform an unsupported\nsource to a supported one (see <a href=\"#examples\">Examples</a> below).</p>"
                },
                {
                  "textRaw": "`globalPreload()`",
                  "type": "method",
                  "name": "globalPreload",
                  "meta": {
                    "changes": [
                      {
                        "version": "v16.17.0",
                        "pr-url": "https://github.com/nodejs/node/pull/42623",
                        "description": "Add support for chaining globalPreload hooks."
                      }
                    ]
                  },
                  "signatures": [
                    {
                      "params": []
                    }
                  ],
                  "desc": "<blockquote>\n<p>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<blockquote>\n<p>In a previous version of this API, this hook was named\n<code>getGlobalPreloadCode</code>.</p>\n</blockquote>\n<ul>\n<li><code>context</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object\" class=\"type\">&lt;Object&gt;</a> Information to assist the preload code\n<ul>\n<li><code>port</code> <a href=\"worker_threads.html#class-messageport\" class=\"type\">&lt;MessagePort&gt;</a></li>\n</ul>\n</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> Code to run before application startup</li>\n</ul>\n<p>Sometimes it might be necessary to run some code inside of the same global\nscope that the application runs in. This hook allows the return of a string\nthat is run as a 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 has to construct\nits own <code>require</code> using  <code>module.createRequire()</code>.</p>\n<pre><code class=\"language-js\">export function globalPreload(context) {\n  return `\\\nglobalThis.someInjectedProperty = 42;\nconsole.log('I just set some globals!');\n\nconst { createRequire } = getBuiltin('module');\nconst { cwd } = getBuiltin('process');\n\nconst require = createRequire(cwd() + '/&#x3C;preload>');\n// [...]\n`;\n}\n</code></pre>\n<p>In order to allow communication between the application and the loader, another\nargument is provided to the preload code: <code>port</code>. This is available as a\nparameter to the loader hook and inside of the source text returned by the hook.\nSome care must be taken in order to properly call <a href=\"https://nodejs.org/dist/latest-v17.x/docs/api/worker_threads.html#portref\"><code>port.ref()</code></a> and\n<a href=\"https://nodejs.org/dist/latest-v17.x/docs/api/worker_threads.html#portunref\"><code>port.unref()</code></a> to prevent a process from being in a state where it won't\nclose normally.</p>\n<pre><code class=\"language-js\">/**\n * This example has the application context send a message to the loader\n * and sends the message back to the application context\n */\nexport function globalPreload({ port }) {\n  port.onmessage = (evt) => {\n    port.postMessage(evt.data);\n  };\n  return `\\\n    port.postMessage('console.log(\"I went to the Loader and back\");');\n    port.onmessage = (evt) => {\n      eval(evt.data);\n    };\n  `;\n}\n</code></pre>\n<h3>Examples</h3>\n<p>The various loader hooks can be used together to accomplish wide-ranging\ncustomizations of the Node.js code loading and evaluation behaviors.</p>"
                }
              ],
              "modules": [
                {
                  "textRaw": "HTTPS loader",
                  "name": "https_loader",
                  "desc": "<p>In current Node.js, specifiers starting with <code>https://</code> are experimental (see\n<a href=\"#https-and-http-imports\">HTTPS and HTTP imports</a>).</p>\n<p>The loader below registers hooks to enable rudimentary support for such\nspecifiers. While this may seem like a significant improvement to Node.js core\nfunctionality, there are substantial downsides to actually using 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 'node:https';\n\nexport function resolve(specifier, context, nextResolve) {\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      shortCircuit: true,\n      url: specifier\n    };\n  } else if (parentURL &#x26;&#x26; parentURL.startsWith('https://')) {\n    return {\n      shortCircuit: true,\n      url: new URL(specifier, parentURL).href,\n    };\n  }\n\n  // Let Node.js handle all other specifiers.\n  return nextResolve(specifier);\n}\n\nexport function load(url, context, nextLoad) {\n  // For JavaScript to be loaded over the network, we need to fetch and\n  // return it.\n  if (url.startsWith('https://')) {\n    return new Promise((resolve, reject) => {\n      get(url, (res) => {\n        let data = '';\n        res.on('data', (chunk) => data += chunk);\n        res.on('end', () => resolve({\n          // This example assumes all network-provided JavaScript is ES module\n          // code.\n          format: 'module',\n          shortCircuit: true,\n          source: data,\n        }));\n      }).on('error', (err) => reject(err));\n    });\n  }\n\n  // Let Node.js handle all other URLs.\n  return nextLoad(url);\n}\n</code></pre>\n<pre><code class=\"language-js\">// main.mjs\nimport { VERSION } from 'https://coffeescript.org/browser-compiler-modern/coffeescript.js';\n\nconsole.log(VERSION);\n</code></pre>\n<p>With the preceding loader, running\n<code>node --experimental-loader ./https-loader.mjs ./main.mjs</code>\nprints 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=\"#loadurl-context-nextload\"><code>load</code> hook</a>. Before that hook gets called,\nhowever, a <a href=\"#resolvespecifier-context-nextresolve\"><code>resolve</code> hook</a> needs to tell Node.js not to\nthrow an error on unknown file types.</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 { readFile } from 'node:fs/promises';\nimport { dirname, extname, resolve as resolvePath } from 'node:path';\nimport { cwd } from 'node:process';\nimport { fileURLToPath, pathToFileURL } from 'node:url';\nimport CoffeeScript from 'coffeescript';\n\nconst baseURL = pathToFileURL(`${cwd()}/`).href;\n\n// CoffeeScript files end in .coffee, .litcoffee, or .coffee.md.\nconst extensionsRegex = /\\.coffee$|\\.litcoffee$|\\.coffee\\.md$/;\n\nexport async function resolve(specifier, context, nextResolve) {\n  if (extensionsRegex.test(specifier)) {\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    return {\n      shortCircuit: true,\n      url: new URL(specifier, parentURL).href\n    };\n  }\n\n  // Let Node.js handle all other specifiers.\n  return nextResolve(specifier);\n}\n\nexport async function load(url, context, nextLoad) {\n  if (extensionsRegex.test(url)) {\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. Because\n    // CoffeeScript transpiles into JavaScript, it should be one of the two\n    // JavaScript formats: 'commonjs' or 'module'.\n\n    // CoffeeScript files can be either CommonJS or ES modules, so we want any\n    // CoffeeScript file to be treated by Node.js the same as a .js file at the\n    // same location. To determine how Node.js would interpret an arbitrary .js\n    // file, search up the file system for the nearest parent package.json file\n    // and read its \"type\" field.\n    const format = await getPackageType(url);\n    // When a hook returns a format of 'commonjs', `source` is be ignored.\n    // To handle CommonJS files, a handler needs to be registered with\n    // `require.extensions` in order to process the files with the CommonJS\n    // loader. Avoiding the need for a separate CommonJS handler is a future\n    // enhancement planned for ES module loaders.\n    if (format === 'commonjs') {\n      return {\n        format,\n        shortCircuit: true,\n      };\n    }\n\n    const { source: rawSource } = await nextLoad(url, { ...context, format });\n    // This hook converts CoffeeScript source code into JavaScript source code\n    // for all imported CoffeeScript files.\n    const transformedSource = coffeeCompile(rawSource.toString(), url);\n\n    return {\n      format,\n      shortCircuit: true,\n      source: transformedSource,\n    };\n  }\n\n  // Let Node.js handle all other URLs.\n  return nextLoad(url);\n}\n\nasync function getPackageType(url) {\n  // `url` is only a file path during the first iteration when passed the\n  // resolved url from the load() hook\n  // an actual file path from load() will contain a file extension as it's\n  // required by the spec\n  // this simple truthy check for whether `url` contains a file extension will\n  // work for most projects but does not cover some edge-cases (such as\n  // extensionless files or a url ending in a trailing space)\n  const isFilePath = !!extname(url);\n  // If it is a file path, get the directory it's in\n  const dir = isFilePath ?\n    dirname(fileURLToPath(url)) :\n    url;\n  // Compose a file path to a package.json in the same directory,\n  // which may or may not exist\n  const packagePath = resolvePath(dir, 'package.json');\n  // Try to read the possibly nonexistent package.json\n  const type = await readFile(packagePath, { encoding: 'utf8' })\n    .then((filestring) => JSON.parse(filestring).type)\n    .catch((err) => {\n      if (err?.code !== 'ENOENT') console.error(err);\n    });\n  // Ff package.json existed and contained a `type` field with a value, voila\n  if (type) return type;\n  // Otherwise, (if not at the root) continue checking the next directory up\n  // If at the root, stop and return false\n  return dir.length > 1 &#x26;&#x26; getPackageType(resolvePath(dir, '..'));\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 'node:process'\nconsole.log \"Brought to you by Node.js version #{version}\"\n</code></pre>\n<pre><code class=\"language-coffee\"># scream.coffee\nexport scream = (str) -> str.toUpperCase()\n</code></pre>\n<p>With the preceding loader, running\n<code>node --experimental-loader ./coffeescript-loader.mjs main.coffee</code>\ncauses <code>main.coffee</code> to be turned into JavaScript after its source code is\nloaded from disk but before Node.js executes it; and so on for any <code>.coffee</code>,\n<code>.litcoffee</code> or <code>.coffee.md</code> files referenced via <code>import</code> statements of any\nloaded file.</p>",
                  "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>defaultConditions</em> is the conditional environment name array,\n<code>[\"node\", \"import\"]</code>.</p>\n<p>The resolver can throw the following errors:</p>\n<ul>\n<li><em>Invalid Module Specifier</em>: Module specifier is an invalid URL, package name\nor package subpath specifier.</li>\n<li><em>Invalid Package Configuration</em>: package.json configuration is invalid or\ncontains an invalid configuration.</li>\n<li><em>Invalid Package Target</em>: Package exports or imports define a target module\nfor the package that is an invalid type or string target.</li>\n<li><em>Package Path Not Exported</em>: Package exports do not define or permit a target\nsubpath in the package for the given module.</li>\n<li><em>Package Import Not Defined</em>: Package imports do not define the specifier.</li>\n<li><em>Module Not Found</em>: The package or module requested does not exist.</li>\n<li><em>Unsupported Directory Import</em>: The resolved path corresponds to a directory,\nwhich is not a supported target for module imports.</li>\n</ul>",
              "type": "module",
              "displayName": "Resolver algorithm"
            },
            {
              "textRaw": "Resolver Algorithm Specification",
              "name": "resolver_algorithm_specification",
              "desc": "<p><strong>ESM_RESOLVE</strong>(<em>specifier</em>, <em>parentURL</em>)</p>\n<blockquote>\n<ol>\n<li>Let <em>resolved</em> be <strong>undefined</strong>.</li>\n<li>If <em>specifier</em> is a valid URL, then\n<ol>\n<li>Set <em>resolved</em> to the result of parsing and reserializing\n<em>specifier</em> as a URL.</li>\n</ol>\n</li>\n<li>Otherwise, if <em>specifier</em> starts with <em>\"/\"</em>, <em>\"./\"</em>, or <em>\"../\"</em>, then\n<ol>\n<li>Set <em>resolved</em> to the URL resolution of <em>specifier</em> relative to\n<em>parentURL</em>.</li>\n</ol>\n</li>\n<li>Otherwise, if <em>specifier</em> starts with <em>\"#\"</em>, then\n<ol>\n<li>Set <em>resolved</em> to the destructured value of the result of\n<strong>PACKAGE_IMPORTS_RESOLVE</strong>(<em>specifier</em>, <em>parentURL</em>,\n<em>defaultConditions</em>).</li>\n</ol>\n</li>\n<li>Otherwise,\n<ol>\n<li>Note: <em>specifier</em> is now a bare specifier.</li>\n<li>Set <em>resolved</em> the result of\n<strong>PACKAGE_RESOLVE</strong>(<em>specifier</em>, <em>parentURL</em>).</li>\n</ol>\n</li>\n<li>Let <em>format</em> be <strong>undefined</strong>.</li>\n<li>If <em>resolved</em> is a <em>\"file:\"</em> URL, then\n<ol>\n<li>If <em>resolved</em> contains any percent encodings of <em>\"/\"</em> or <em>\"\\\"</em> (<em>\"%2F\"</em>\nand <em>\"%5C\"</em> respectively), then\n<ol>\n<li>Throw an <em>Invalid Module Specifier</em> error.</li>\n</ol>\n</li>\n<li>If the file at <em>resolved</em> is a directory, then\n<ol>\n<li>Throw an <em>Unsupported Directory Import</em> error.</li>\n</ol>\n</li>\n<li>If the file at <em>resolved</em> does not exist, then\n<ol>\n<li>Throw a <em>Module Not Found</em> error.</li>\n</ol>\n</li>\n<li>Set <em>resolved</em> to the real path of <em>resolved</em>, maintaining the\nsame URL querystring and fragment components.</li>\n<li>Set <em>format</em> to the result of <strong>ESM_FILE_FORMAT</strong>(<em>resolved</em>).</li>\n</ol>\n</li>\n<li>Otherwise,\n<ol>\n<li>Set <em>format</em> the module format of the content type associated with the\nURL <em>resolved</em>.</li>\n</ol>\n</li>\n<li>Load <em>resolved</em> as module format, <em>format</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 <strong>undefined</strong>.</li>\n<li>If <em>packageSpecifier</em> is an empty string, then\n<ol>\n<li>Throw an <em>Invalid Module Specifier</em> error.</li>\n</ol>\n</li>\n<li>If <em>packageSpecifier</em> is a Node.js builtin module name, then\n<ol>\n<li>Return the string <em>\"node:\"</em> concatenated with <em>packageSpecifier</em>.</li>\n</ol>\n</li>\n<li>If <em>packageSpecifier</em> does not start with <em>\"@\"</em>, then\n<ol>\n<li>Set <em>packageName</em> to the substring of <em>packageSpecifier</em> until the first\n<em>\"/\"</em> separator or the end of the string.</li>\n</ol>\n</li>\n<li>Otherwise,\n<ol>\n<li>If <em>packageSpecifier</em> does not contain a <em>\"/\"</em> separator, then\n<ol>\n<li>Throw an <em>Invalid Module Specifier</em> error.</li>\n</ol>\n</li>\n<li>Set <em>packageName</em> to the substring of <em>packageSpecifier</em>\nuntil the second <em>\"/\"</em> separator or the end of the string.</li>\n</ol>\n</li>\n<li>If <em>packageName</em> starts with <em>\".\"</em> or contains <em>\"\\\"</em> or <em>\"%\"</em>, then\n<ol>\n<li>Throw an <em>Invalid Module Specifier</em> error.</li>\n</ol>\n</li>\n<li>Let <em>packageSubpath</em> be <em>\".\"</em> concatenated with the substring of\n<em>packageSpecifier</em> from the position at the length of <em>packageName</em>.</li>\n<li>If <em>packageSubpath</em> ends in <em>\"/\"</em>, then\n<ol>\n<li>Throw an <em>Invalid Module Specifier</em> error.</li>\n</ol>\n</li>\n<li>Let <em>selfUrl</em> be the result of\n<strong>PACKAGE_SELF_RESOLVE</strong>(<em>packageName</em>, <em>packageSubpath</em>, <em>parentURL</em>).</li>\n<li>If <em>selfUrl</em> is not <strong>undefined</strong>, return <em>selfUrl</em>.</li>\n<li>While <em>parentURL</em> is not the file system root,\n<ol>\n<li>Let <em>packageURL</em> be the URL resolution of <em>\"node_modules/\"</em>\nconcatenated with <em>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>If the folder at <em>packageURL</em> does not exist, then\n<ol>\n<li>Continue the next loop iteration.</li>\n</ol>\n</li>\n<li>Let <em>pjson</em> be the result of <strong>READ_PACKAGE_JSON</strong>(<em>packageURL</em>).</li>\n<li>If <em>pjson</em> is not <strong>null</strong> and <em>pjson</em>.<em>exports</em> is not <strong>null</strong> or\n<strong>undefined</strong>, then\n<ol>\n<li>Return the result of <strong>PACKAGE_EXPORTS_RESOLVE</strong>(<em>packageURL</em>,\n<em>packageSubpath</em>, <em>pjson.exports</em>, <em>defaultConditions</em>).</li>\n</ol>\n</li>\n<li>Otherwise, if <em>packageSubpath</em> is equal to <em>\".\"</em>, then\n<ol>\n<li>If <em>pjson.main</em> is a string, then\n<ol>\n<li>Return the URL resolution of <em>main</em> in <em>packageURL</em>.</li>\n</ol>\n</li>\n</ol>\n</li>\n<li>Otherwise,\n<ol>\n<li>Return the URL resolution of <em>packageSubpath</em> in <em>packageURL</em>.</li>\n</ol>\n</li>\n</ol>\n</li>\n<li>Throw a <em>Module Not Found</em> error.</li>\n</ol>\n</blockquote>\n<p><strong>PACKAGE_SELF_RESOLVE</strong>(<em>packageName</em>, <em>packageSubpath</em>, <em>parentURL</em>)</p>\n<blockquote>\n<ol>\n<li>Let <em>packageURL</em> be the result of <strong>LOOKUP_PACKAGE_SCOPE</strong>(<em>parentURL</em>).</li>\n<li>If <em>packageURL</em> is <strong>null</strong>, then\n<ol>\n<li>Return <strong>undefined</strong>.</li>\n</ol>\n</li>\n<li>Let <em>pjson</em> be the result of <strong>READ_PACKAGE_JSON</strong>(<em>packageURL</em>).</li>\n<li>If <em>pjson</em> is <strong>null</strong> or if <em>pjson</em>.<em>exports</em> is <strong>null</strong> or\n<strong>undefined</strong>, then\n<ol>\n<li>Return <strong>undefined</strong>.</li>\n</ol>\n</li>\n<li>If <em>pjson.name</em> is equal to <em>packageName</em>, then\n<ol>\n<li>Return the <em>resolved</em> destructured value of the result of\n<strong>PACKAGE_EXPORTS_RESOLVE</strong>(<em>packageURL</em>, <em>packageSubpath</em>,\n<em>pjson.exports</em>, <em>defaultConditions</em>).</li>\n</ol>\n</li>\n<li>Otherwise, return <strong>undefined</strong>.</li>\n</ol>\n</blockquote>\n<p><strong>PACKAGE_EXPORTS_RESOLVE</strong>(<em>packageURL</em>, <em>subpath</em>, <em>exports</em>, <em>conditions</em>)</p>\n<blockquote>\n<ol>\n<li>If <em>exports</em> is an Object with both a key starting with <em>\".\"</em> and a key not\nstarting with <em>\".\"</em>, throw an <em>Invalid Package Configuration</em> error.</li>\n<li>If <em>subpath</em> is equal to <em>\".\"</em>, then\n<ol>\n<li>Let <em>mainExport</em> be <strong>undefined</strong>.</li>\n<li>If <em>exports</em> is a String or Array, or an Object containing no keys\nstarting with <em>\".\"</em>, then\n<ol>\n<li>Set <em>mainExport</em> to <em>exports</em>.</li>\n</ol>\n</li>\n<li>Otherwise if <em>exports</em> is an Object containing a <em>\".\"</em> property, then\n<ol>\n<li>Set <em>mainExport</em> to <em>exports</em>[<em>\".\"</em>].</li>\n</ol>\n</li>\n<li>If <em>mainExport</em> is not <strong>undefined</strong>, then\n<ol>\n<li>Let <em>resolved</em> be the result of <strong>PACKAGE_TARGET_RESOLVE</strong>(\n<em>packageURL</em>, <em>mainExport</em>, <em>\"\"</em>, <strong>false</strong>, <strong>false</strong>,\n<em>conditions</em>).</li>\n<li>If <em>resolved</em> is not <strong>null</strong> or <strong>undefined</strong>, then\n<ol>\n<li>Return <em>resolved</em>.</li>\n</ol>\n</li>\n</ol>\n</li>\n</ol>\n</li>\n<li>Otherwise, if <em>exports</em> is an Object and all keys of <em>exports</em> start with\n<em>\".\"</em>, then\n<ol>\n<li>Let <em>matchKey</em> be the string <em>\"./\"</em> concatenated with <em>subpath</em>.</li>\n<li>Let <em>resolvedMatch</em> be result of <strong>PACKAGE_IMPORTS_EXPORTS_RESOLVE</strong>(\n<em>matchKey</em>, <em>exports</em>, <em>packageURL</em>, <strong>false</strong>, <em>conditions</em>).</li>\n<li>If <em>resolvedMatch</em>.<em>resolve</em> is not <strong>null</strong> or <strong>undefined</strong>, then\n<ol>\n<li>Return <em>resolvedMatch</em>.</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_IMPORTS_RESOLVE</strong>(<em>specifier</em>, <em>parentURL</em>, <em>conditions</em>)</p>\n<blockquote>\n<ol>\n<li>Assert: <em>specifier</em> begins with <em>\"#\"</em>.</li>\n<li>If <em>specifier</em> is exactly equal to <em>\"#\"</em> or starts with <em>\"#/\"</em>, then\n<ol>\n<li>Throw an <em>Invalid Module Specifier</em> error.</li>\n</ol>\n</li>\n<li>Let <em>packageURL</em> be the result of <strong>LOOKUP_PACKAGE_SCOPE</strong>(<em>parentURL</em>).</li>\n<li>If <em>packageURL</em> is not <strong>null</strong>, then\n<ol>\n<li>Let <em>pjson</em> be the result of <strong>READ_PACKAGE_JSON</strong>(<em>packageURL</em>).</li>\n<li>If <em>pjson.imports</em> is a non-null Object, then\n<ol>\n<li>Let <em>resolvedMatch</em> be the result of\n<strong>PACKAGE_IMPORTS_EXPORTS_RESOLVE</strong>(<em>specifier</em>, <em>pjson.imports</em>,\n<em>packageURL</em>, <strong>true</strong>, <em>conditions</em>).</li>\n<li>If <em>resolvedMatch</em>.<em>resolve</em> is not <strong>null</strong> or <strong>undefined</strong>, then\n<ol>\n<li>Return <em>resolvedMatch</em>.</li>\n</ol>\n</li>\n</ol>\n</li>\n</ol>\n</li>\n<li>Throw a <em>Package Import Not Defined</em> error.</li>\n</ol>\n</blockquote>\n<p><strong>PACKAGE_IMPORTS_EXPORTS_RESOLVE</strong>(<em>matchKey</em>, <em>matchObj</em>, <em>packageURL</em>,\n<em>isImports</em>, <em>conditions</em>)</p>\n<blockquote>\n<ol>\n<li>If <em>matchKey</em> is a key of <em>matchObj</em> and does not end in <em>\"/\"</em> or contain\n<em>\"*\"</em>, then\n<ol>\n<li>Let <em>target</em> be the value of <em>matchObj</em>[<em>matchKey</em>].</li>\n<li>Let <em>resolved</em> be the result of <strong>PACKAGE_TARGET_RESOLVE</strong>(\n<em>packageURL</em>, <em>target</em>, <em>\"\"</em>, <strong>false</strong>, <em>isImports</em>, <em>conditions</em>).</li>\n<li>Return the object <em>{ resolved, exact: <strong>true</strong> }</em>.</li>\n</ol>\n</li>\n<li>Let <em>expansionKeys</em> be the list of keys of <em>matchObj</em> either ending in\n<em>\"/\"</em> or containing only a single <em>\"*\"</em>, sorted by the sorting function\n<strong>PATTERN_KEY_COMPARE</strong> which orders in descending order of specificity.</li>\n<li>For each key <em>expansionKey</em> in <em>expansionKeys</em>, do\n<ol>\n<li>Let <em>patternBase</em> be <strong>null</strong>.</li>\n<li>If <em>expansionKey</em> contains <em>\"*\"</em>, set <em>patternBase</em> to the substring of\n<em>expansionKey</em> up to but excluding the first <em>\"*\"</em> character.</li>\n<li>If <em>patternBase</em> is not <strong>null</strong> and <em>matchKey</em> starts with but is not\nequal to <em>patternBase</em>, then\n<ol>\n<li>If <em>matchKey</em> ends with <em>\"/\"</em>, throw an <em>Invalid Module Specifier</em>\nerror.</li>\n<li>Let <em>patternTrailer</em> be the substring of <em>expansionKey</em> from the\nindex after the first <em>\"*\"</em> character.</li>\n<li>If <em>patternTrailer</em> has zero length, or if <em>matchKey</em> ends with\n<em>patternTrailer</em> and the length of <em>matchKey</em> is greater than or\nequal to the length of <em>expansionKey</em>, then\n<ol>\n<li>Let <em>target</em> be the value of <em>matchObj</em>[<em>expansionKey</em>].</li>\n<li>Let <em>subpath</em> be the substring of <em>matchKey</em> starting at the\nindex of the length of <em>patternBase</em> up to the length of\n<em>matchKey</em> minus the length of <em>patternTrailer</em>.</li>\n<li>Let <em>resolved</em> be the result of <strong>PACKAGE_TARGET_RESOLVE</strong>(\n<em>packageURL</em>, <em>target</em>, <em>subpath</em>, <strong>true</strong>, <em>isImports</em>,\n<em>conditions</em>).</li>\n<li>Return the object <em>{ resolved, exact: <strong>true</strong> }</em>.</li>\n</ol>\n</li>\n</ol>\n</li>\n<li>Otherwise if <em>patternBase</em> is <strong>null</strong> and <em>matchKey</em> starts with\n<em>expansionKey</em>, then\n<ol>\n<li>Let <em>target</em> be the value of <em>matchObj</em>[<em>expansionKey</em>].</li>\n<li>Let <em>subpath</em> be the substring of <em>matchKey</em> starting at the\nindex of the length of <em>expansionKey</em>.</li>\n<li>Let <em>resolved</em> be the result of <strong>PACKAGE_TARGET_RESOLVE</strong>(\n<em>packageURL</em>, <em>target</em>, <em>subpath</em>, <strong>false</strong>, <em>isImports</em>,\n<em>conditions</em>).</li>\n<li>Return the object <em>{ resolved, exact: <strong>false</strong> }</em>.</li>\n</ol>\n</li>\n</ol>\n</li>\n<li>Return the object <em>{ resolved: <strong>null</strong>, exact: <strong>true</strong> }</em>.</li>\n</ol>\n</blockquote>\n<p><strong>PATTERN_KEY_COMPARE</strong>(<em>keyA</em>, <em>keyB</em>)</p>\n<blockquote>\n<ol>\n<li>Assert: <em>keyA</em> ends with <em>\"/\"</em> or contains only a single <em>\"*\"</em>.</li>\n<li>Assert: <em>keyB</em> ends with <em>\"/\"</em> or contains only a single <em>\"*\"</em>.</li>\n<li>Let <em>baseLengthA</em> be the index of <em>\"*\"</em> in <em>keyA</em> plus one, if <em>keyA</em>\ncontains <em>\"*\"</em>, or the length of <em>keyA</em> otherwise.</li>\n<li>Let <em>baseLengthB</em> be the index of <em>\"*\"</em> in <em>keyB</em> plus one, if <em>keyB</em>\ncontains <em>\"*\"</em>, or the length of <em>keyB</em> otherwise.</li>\n<li>If <em>baseLengthA</em> is greater than <em>baseLengthB</em>, return -1.</li>\n<li>If <em>baseLengthB</em> is greater than <em>baseLengthA</em>, return 1.</li>\n<li>If <em>keyA</em> does not contain <em>\"*\"</em>, return 1.</li>\n<li>If <em>keyB</em> does not contain <em>\"*\"</em>, return -1.</li>\n<li>If the length of <em>keyA</em> is greater than the length of <em>keyB</em>, return -1.</li>\n<li>If the length of <em>keyB</em> is greater than the length of <em>keyA</em>, return 1.</li>\n<li>Return 0.</li>\n</ol>\n</blockquote>\n<p><strong>PACKAGE_TARGET_RESOLVE</strong>(<em>packageURL</em>, <em>target</em>, <em>subpath</em>, <em>pattern</em>,\n<em>internal</em>, <em>conditions</em>)</p>\n<blockquote>\n<ol>\n<li>If <em>target</em> is a String, then\n<ol>\n<li>If <em>pattern</em> is <strong>false</strong>, <em>subpath</em> has non-zero length and <em>target</em>\ndoes not end with <em>\"/\"</em>, throw an <em>Invalid Module Specifier</em> error.</li>\n<li>If <em>target</em> does not start with <em>\"./\"</em>, then\n<ol>\n<li>If <em>internal</em> is <strong>true</strong> and <em>target</em> does not start with <em>\"../\"</em> or\n<em>\"/\"</em> and is not a valid URL, then\n<ol>\n<li>If <em>pattern</em> is <strong>true</strong>, then\n<ol>\n<li>Return <strong>PACKAGE_RESOLVE</strong>(<em>target</em> with every instance of\n<em>\"*\"</em> replaced by <em>subpath</em>, <em>packageURL</em> + <em>\"/\"</em>).</li>\n</ol>\n</li>\n<li>Return <strong>PACKAGE_RESOLVE</strong>(<em>target</em> + <em>subpath</em>,\n<em>packageURL</em> + <em>\"/\"</em>).</li>\n</ol>\n</li>\n<li>Otherwise, throw an <em>Invalid Package Target</em> error.</li>\n</ol>\n</li>\n<li>If <em>target</em> split on <em>\"/\"</em> or <em>\"\\\"</em> contains any <em>\".\"</em>, <em>\"..\"</em>, or\n<em>\"node_modules\"</em> segments after the first segment, case insensitive and\nincluding percent encoded variants, throw an <em>Invalid Package Target</em>\nerror.</li>\n<li>Let <em>resolvedTarget</em> be the URL resolution of the concatenation of\n<em>packageURL</em> and <em>target</em>.</li>\n<li>Assert: <em>resolvedTarget</em> is contained in <em>packageURL</em>.</li>\n<li>If <em>subpath</em> split on <em>\"/\"</em> or <em>\"\\\"</em> contains any <em>\".\"</em>, <em>\"..\"</em>, or\n<em>\"node_modules\"</em> segments, case insensitive and including percent\nencoded variants, throw an <em>Invalid Module Specifier</em> error.</li>\n<li>If <em>pattern</em> is <strong>true</strong>, then\n<ol>\n<li>Return the URL resolution of <em>resolvedTarget</em> with every instance of\n<em>\"*\"</em> replaced with <em>subpath</em>.</li>\n</ol>\n</li>\n<li>Otherwise,\n<ol>\n<li>Return the URL resolution of the concatenation of <em>subpath</em> and\n<em>resolvedTarget</em>.</li>\n</ol>\n</li>\n</ol>\n</li>\n<li>Otherwise, if <em>target</em> is a non-null Object, then\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>For each property <em>p</em> of <em>target</em>, in object insertion order as,\n<ol>\n<li>If <em>p</em> equals <em>\"default\"</em> or <em>conditions</em> contains an entry for <em>p</em>,\nthen\n<ol>\n<li>Let <em>targetValue</em> be the value of the <em>p</em> property in <em>target</em>.</li>\n<li>Let <em>resolved</em> be the result of <strong>PACKAGE_TARGET_RESOLVE</strong>(\n<em>packageURL</em>, <em>targetValue</em>, <em>subpath</em>, <em>pattern</em>, <em>internal</em>,\n<em>conditions</em>).</li>\n<li>If <em>resolved</em> is equal to <strong>undefined</strong>, continue the loop.</li>\n<li>Return <em>resolved</em>.</li>\n</ol>\n</li>\n</ol>\n</li>\n<li>Return <strong>undefined</strong>.</li>\n</ol>\n</li>\n<li>Otherwise, if <em>target</em> is an Array, then\n<ol>\n<li>If _target.length is zero, return <strong>null</strong>.</li>\n<li>For each item <em>targetValue</em> in <em>target</em>, do\n<ol>\n<li>Let <em>resolved</em> be the result of <strong>PACKAGE_TARGET_RESOLVE</strong>(\n<em>packageURL</em>, <em>targetValue</em>, <em>subpath</em>, <em>pattern</em>, <em>internal</em>,\n<em>conditions</em>), continuing the loop on any <em>Invalid Package Target</em>\nerror.</li>\n<li>If <em>resolved</em> is <strong>undefined</strong>, continue the loop.</li>\n<li>Return <em>resolved</em>.</li>\n</ol>\n</li>\n<li>Return or throw the last fallback resolution <strong>null</strong> return or error.</li>\n</ol>\n</li>\n<li>Otherwise, if <em>target</em> is <em>null</em>, return <strong>null</strong>.</li>\n<li>Otherwise throw an <em>Invalid Package Target</em> error.</li>\n</ol>\n</blockquote>\n<p><strong>ESM_FILE_FORMAT</strong>(<em>url</em>)</p>\n<blockquote>\n<ol>\n<li>Assert: <em>url</em> corresponds to an existing file.</li>\n<li>If <em>url</em> ends in <em>\".mjs\"</em>, then\n<ol>\n<li>Return <em>\"module\"</em>.</li>\n</ol>\n</li>\n<li>If <em>url</em> ends in <em>\".cjs\"</em>, then\n<ol>\n<li>Return <em>\"commonjs\"</em>.</li>\n</ol>\n</li>\n<li>If <em>url</em> ends in <em>\".json\"</em>, then\n<ol>\n<li>Return <em>\"json\"</em>.</li>\n</ol>\n</li>\n<li>Let <em>packageURL</em> be the result of <strong>LOOKUP_PACKAGE_SCOPE</strong>(<em>url</em>).</li>\n<li>Let <em>pjson</em> be the result of <strong>READ_PACKAGE_JSON</strong>(<em>packageURL</em>).</li>\n<li>If <em>pjson?.type</em> exists and is <em>\"module\"</em>, then\n<ol>\n<li>If <em>url</em> ends in <em>\".js\"</em>, then\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>Otherwise,\n<ol>\n<li>Throw an <em>Unsupported File Extension</em> error.</li>\n</ol>\n</li>\n</ol>\n</blockquote>\n<p><strong>LOOKUP_PACKAGE_SCOPE</strong>(<em>url</em>)</p>\n<blockquote>\n<ol>\n<li>Let <em>scopeURL</em> be <em>url</em>.</li>\n<li>While <em>scopeURL</em> is not the file system root,\n<ol>\n<li>Set <em>scopeURL</em> to the parent URL of <em>scopeURL</em>.</li>\n<li>If <em>scopeURL</em> ends in a <em>\"node_modules\"</em> path segment, return <strong>null</strong>.</li>\n<li>Let <em>pjsonURL</em> be the resolution of <em>\"package.json\"</em> within\n<em>scopeURL</em>.</li>\n<li>if the file at <em>pjsonURL</em> exists, then\n<ol>\n<li>Return <em>scopeURL</em>.</li>\n</ol>\n</li>\n</ol>\n</li>\n<li>Return <strong>null</strong>.</li>\n</ol>\n</blockquote>\n<p><strong>READ_PACKAGE_JSON</strong>(<em>packageURL</em>)</p>\n<blockquote>\n<ol>\n<li>Let <em>pjsonURL</em> be the resolution of <em>\"package.json\"</em> within <em>packageURL</em>.</li>\n<li>If the file at <em>pjsonURL</em> does not exist, then\n<ol>\n<li>Return <strong>null</strong>.</li>\n</ol>\n</li>\n<li>If the file at <em>packageURL</em> does not parse as valid JSON, then\n<ol>\n<li>Throw an <em>Invalid Package Configuration</em> error.</li>\n</ol>\n</li>\n<li>Return the parsed JSON source of the file at <em>pjsonURL</em>.</li>\n</ol>\n</blockquote>",
              "type": "module",
              "displayName": "Resolver Algorithm Specification"
            },
            {
              "textRaw": "Customizing ESM specifier resolution algorithm",
              "name": "customizing_esm_specifier_resolution_algorithm",
              "stability": 1,
              "stabilityText": "Experimental",
              "desc": "<blockquote>\n<p>Do not rely on this flag. We plan to remove it once the\n<a href=\"#loaders\">Loaders API</a> has advanced to the point that equivalent functionality can\nbe achieved via custom loaders.</p>\n</blockquote>\n<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-console\">$ node index.mjs\nsuccess!\n$ node index # Failure!\nError: Cannot find module\n$ node --experimental-specifier-resolution=node index\nsuccess!\n</code></pre>\n<!-- Note: The cjs-module-lexer link should be kept in-sync with the deps version -->",
              "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> meta property is an <code>Object</code> that contains the following\nproperties.</p>",
          "properties": [
            {
              "textRaw": "`url` {string} The absolute `file:` URL of the module.",
              "type": "string",
              "name": "url",
              "desc": "<p>This is defined exactly the same as it is in browsers providing the URL of the\ncurrent module file.</p>\n<p>This enables useful patterns such as relative file loading:</p>\n<pre><code class=\"language-js\">import { readFileSync } from 'node:fs';\nconst buffer = readFileSync(new URL('./data.proto', import.meta.url));\n</code></pre>",
              "shortDesc": "The absolute `file:` URL of the module."
            }
          ],
          "methods": [
            {
              "textRaw": "`import.meta.resolve(specifier[, parent])`",
              "type": "method",
              "name": "resolve",
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<!--\nadded:\n  - v13.9.0\n  - v12.16.2\nchanges:\n  - version: v16.2.0\n    pr-url: https://github.com/nodejs/node/pull/38587\n    description: Add support for WHATWG `URL` object to `parentURL` parameter.\n-->\n<blockquote>\n<p>Stability: 1 - Experimental</p>\n</blockquote>\n<p>This feature is only available with the <code>--experimental-import-meta-resolve</code>\ncommand flag enabled.</p>\n<ul>\n<li><code>specifier</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string&gt;</a> The module specifier to resolve relative to <code>parent</code>.</li>\n<li><code>parent</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type\" class=\"type\">&lt;string&gt;</a> | <a href=\"url.html#the-whatwg-url-api\" class=\"type\">&lt;URL&gt;</a> The absolute parent module URL to resolve from. If none\nis specified, the value of <code>import.meta.url</code> is used as the default.</li>\n<li>Returns: <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise\" class=\"type\">&lt;Promise&gt;</a></li>\n</ul>\n<p>Provides a module-relative resolution function scoped to each module, returning\nthe URL string.</p>\n<!-- eslint-skip -->\n<pre><code class=\"language-js\">const dependencyAsset = await import.meta.resolve('component-lib/asset.css');\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<!-- eslint-skip -->\n<pre><code class=\"language-js\">await import.meta.resolve('./dep', import.meta.url);\n</code></pre>\n<p>This function is asynchronous because the ES module resolver in Node.js is\nallowed to be asynchronous.</p>"
            }
          ]
        }
      ]
    }
  ]
}