Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorRich Trott <rtrott@gmail.com>2022-04-14 21:22:15 +0300
committerGitHub <noreply@github.com>2022-04-14 21:22:15 +0300
commitaa88e5e4b90af1f16ece3250fbb840e3790c5c81 (patch)
tree8738c394b4ba1d21b8b9148fa56b3d4fc5582dee /doc
parente938515b413d38ffd170f92539e81a7c8b3d548d (diff)
doc: revise data imports and node: imports sections
Revise for conformance with style guide and clarity. PR-URL: https://github.com/nodejs/node/pull/42734 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Diffstat (limited to 'doc')
-rw-r--r--doc/api/esm.md21
1 files changed, 10 insertions, 11 deletions
diff --git a/doc/api/esm.md b/doc/api/esm.md
index c0f7e5fe3f7..bea63a9d20c 100644
--- a/doc/api/esm.md
+++ b/doc/api/esm.md
@@ -178,7 +178,7 @@ The volume root may be referenced via `/`, `//` or `file:///`. Given the
differences between [URL][] and path resolution (such as percent encoding
details), it is recommended to use [url.pathToFileURL][] when importing a path.
-#### `data:` Imports
+#### `data:` imports
<!-- YAML
added: v12.10.0
@@ -186,24 +186,23 @@ added: v12.10.0
[`data:` URLs][] are supported for importing with the following MIME types:
-* `text/javascript` for ES Modules
+* `text/javascript` for ES modules
* `application/json` for JSON
* `application/wasm` for Wasm
-`data:` URLs only resolve [_Bare specifiers_][Terminology] for builtin modules
-and [_Absolute specifiers_][Terminology]. Resolving
-[_Relative specifiers_][Terminology] does not work because `data:` is not a
-[special scheme][]. For example, attempting to load `./foo`
-from `data:text/javascript,import "./foo";` fails to resolve because there
-is no concept of relative resolution for `data:` URLs. An example of a `data:`
-URLs being used is:
-
```js
import 'data:text/javascript,console.log("hello!");';
import _ from 'data:application/json,"world!"' assert { type: 'json' };
```
-#### `node:` Imports
+`data:` URLs only resolve [bare specifiers][Terminology] for builtin modules
+and [absolute specifiers][Terminology]. Resolving
+[relative specifiers][Terminology] does not work because `data:` is not a
+[special scheme][]. For example, attempting to load `./foo`
+from `data:text/javascript,import "./foo";` fails to resolve because there
+is no concept of relative resolution for `data:` URLs.
+
+#### `node:` imports
<!-- YAML
added: