aboutsummaryrefslogtreecommitdiff
path: root/doc/api/esm.md
diff options
context:
space:
mode:
Diffstat (limited to 'doc/api/esm.md')
-rw-r--r--doc/api/esm.md8
1 files changed, 8 insertions, 0 deletions
diff --git a/doc/api/esm.md b/doc/api/esm.md
index 1d6ae5d599..114e3319e1 100644
--- a/doc/api/esm.md
+++ b/doc/api/esm.md
@@ -710,6 +710,7 @@ _isMain_ is **true** when resolving the Node.js application entry point.
<summary>Resolver algorithm specification</summary>
**ESM_RESOLVE**(_specifier_, _parentURL_, _isMain_)
+
> 1. Let _resolvedURL_ be **undefined**.
> 1. If _specifier_ is a valid URL, then
> 1. Set _resolvedURL_ to the result of parsing and reserializing
@@ -733,6 +734,7 @@ _isMain_ is **true** when resolving the Node.js application entry point.
> 1. Load _resolvedURL_ as module format, _format_.
**PACKAGE_RESOLVE**(_packageSpecifier_, _parentURL_)
+
> 1. Let _packageName_ be *undefined*.
> 1. Let _packageSubpath_ be *undefined*.
> 1. If _packageSpecifier_ is an empty string, then
@@ -779,6 +781,7 @@ _isMain_ is **true** when resolving the Node.js application entry point.
> 1. Throw a _Module Not Found_ error.
**PACKAGE_MAIN_RESOLVE**(_packageURL_, _pjson_)
+
> 1. If _pjson_ is **null**, then
> 1. Throw a _Module Not Found_ error.
> 1. If _pjson.main_ is a String, then
@@ -794,6 +797,7 @@ _isMain_ is **true** when resolving the Node.js application entry point.
> 1. Return _legacyMainURL_.
**PACKAGE_EXPORTS_RESOLVE**(_packageURL_, _packagePath_, _exports_)
+
> 1. If _exports_ is an Object, then
> 1. Set _packagePath_ to _"./"_ concatenated with _packagePath_.
> 1. If _packagePath_ is a key of _exports_, then
@@ -812,6 +816,7 @@ _isMain_ is **true** when resolving the Node.js application entry point.
> 1. Throw a _Module Not Found_ error.
**PACKAGE_EXPORTS_TARGET_RESOLVE**(_packageURL_, _target_, _subpath_)
+
> 1. If _target_ is a String, then
> 1. If _target_ does not start with _"./"_, throw a _Module Not Found_
> error.
@@ -837,6 +842,7 @@ _isMain_ is **true** when resolving the Node.js application entry point.
> 1. Throw a _Module Not Found_ error.
**ESM_FORMAT**(_url_, _isMain_)
+
> 1. Assert: _url_ corresponds to an existing file.
> 1. Let _pjson_ be the result of **READ_PACKAGE_SCOPE**(_url_).
> 1. If _url_ ends in _".mjs"_, then
@@ -854,6 +860,7 @@ _isMain_ is **true** when resolving the Node.js application entry point.
> 1. Throw an _Unsupported File Extension_ error.
**READ_PACKAGE_SCOPE**(_url_)
+
> 1. Let _scopeURL_ be _url_.
> 1. While _scopeURL_ is not the file system root,
> 1. If _scopeURL_ ends in a _"node_modules"_ path segment, return **null**.
@@ -864,6 +871,7 @@ _isMain_ is **true** when resolving the Node.js application entry point.
> 1. Return **null**.
**READ_PACKAGE_JSON**(_packageURL_)
+
> 1. Let _pjsonURL_ be the resolution of _"package.json"_ within _packageURL_.
> 1. If the file at _pjsonURL_ does not exist, then
> 1. Return **null**.