Skip to content

Commit 3d92689

Browse files
vsemozhetbyttrivikr
authored andcommitted
doc: fix some recent doc nits
* Fix formatting. * Fix list numbering. * Unify abbreviation casing. * Use an uppercased constructor in a hypothetic code example. * Fix typos. * Fix sorting in sections and references. PR-URL: #30341 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Guy Bedford <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Jiawen Geng <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 796f3d0 commit 3d92689

File tree

4 files changed

+19
-19
lines changed

4 files changed

+19
-19
lines changed

doc/api/cli.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -168,9 +168,9 @@ The default is `explicit`, which requires providing the full path to a
168168
module. The `node` mode will enable support for optional file extensions and
169169
the ability to import a directory that has an index file.
170170

171-
Please see [customizing esm specifier resolution][] for example usage.
171+
Please see [customizing ESM specifier resolution][] for example usage.
172172

173-
### `--experimental-conditional-exports
173+
### `--experimental-conditional-exports`
174174
<!-- YAML
175175
added: REPLACEME
176176
-->
@@ -1321,17 +1321,17 @@ greater than `4` (its current default value). For more information, see the
13211321
[`tls.DEFAULT_MIN_VERSION`]: tls.html#tls_tls_default_min_version
13221322
[`unhandledRejection`]: process.html#process_event_unhandledrejection
13231323
[Chrome DevTools Protocol]: https://chromedevtools.github.io/devtools-protocol/
1324+
[Conditional Exports]: esm.html#esm_conditional_exports
13241325
[REPL]: repl.html
13251326
[ScriptCoverage]: https://chromedevtools.github.io/devtools-protocol/tot/Profiler#type-ScriptCoverage
13261327
[Source Map]: https://sourcemaps.info/spec.html
13271328
[Subresource Integrity]: https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity
13281329
[V8 JavaScript code coverage]: https://v8project.blogspot.com/2017/12/javascript-code-coverage.html
1329-
[customizing esm specifier resolution]: esm.html#esm_customizing_esm_specifier_resolution_algorithm
1330+
[context-aware]: addons.html#addons_context_aware_addons
1331+
[customizing ESM specifier resolution]: esm.html#esm_customizing_esm_specifier_resolution_algorithm
13301332
[debugger]: debugger.html
13311333
[debugging security implications]: https://nodejs.org/en/docs/guides/debugging-getting-started/#security-implications
13321334
[emit_warning]: process.html#process_process_emitwarning_warning_type_code_ctor
13331335
[experimental ECMAScript Module loader]: esm.html#esm_resolve_hook
13341336
[libuv threadpool documentation]: http://docs.libuv.org/en/latest/threadpool.html
13351337
[remote code execution]: https://www.owasp.org/index.php/Code_Injection
1336-
[context-aware]: addons.html#addons_context_aware_addons
1337-
[Conditional Exports]: esm.html#esm_conditional_exports

doc/api/esm.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -622,9 +622,9 @@ CommonJS and ES module instances of the package:
622622
package, it would be used like this:
623623

624624
```js
625-
import date from 'date';
626-
const someDate = new date();
627-
// someDate contains state; date does not
625+
import Date from 'date';
626+
const someDate = new Date();
627+
// someDate contains state; Date does not
628628
```
629629

630630
The `new` keyword isn’t required; a package’s function can return a new
@@ -1217,7 +1217,7 @@ _defaultEnv_ is the conditional environment name priority array,
12171217
> 1. Throw a _Module Not Found_ error.
12181218
> 1. If _pjson.exports_ is not **null** or **undefined**, then
12191219
> 1. If _exports_ is an Object with both a key starting with _"."_ and a key
1220-
> not starting with _"."_, throw a "Invalid Package Configuration" error.
1220+
> not starting with _"."_, throw an "Invalid Package Configuration" error.
12211221
> 1. If _pjson.exports_ is a String or Array, or an Object containing no
12221222
> keys starting with _"."_, then
12231223
> 1. Return **PACKAGE_EXPORTS_TARGET_RESOLVE**(_packageURL_,

doc/api/modules.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -234,15 +234,15 @@ RESOLVE_BARE_SPECIFIER(DIR, X)
234234
b. If "exports" is null or undefined, GOTO 3.
235235
c. If "exports" is an object with some keys starting with "." and some keys
236236
not starting with ".", throw "invalid config".
237-
c. If "exports" is a string, or object with no keys starting with ".", treat
237+
d. If "exports" is a string, or object with no keys starting with ".", treat
238238
it as having that value as its "." object property.
239-
d. If subpath is "." and "exports" does not have a "." entry, GOTO 3.
240-
e. Find the longest key in "exports" that the subpath starts with.
241-
f. If no such key can be found, throw "not found".
242-
g. let RESOLVED_URL =
239+
e. If subpath is "." and "exports" does not have a "." entry, GOTO 3.
240+
f. Find the longest key in "exports" that the subpath starts with.
241+
g. If no such key can be found, throw "not found".
242+
h. let RESOLVED_URL =
243243
PACKAGE_EXPORTS_TARGET_RESOLVE(pathToFileURL(DIR/name), exports[key],
244-
subpath.slice(key.length)), as defined in the esm resolver.
245-
h. return fileURLToPath(RESOLVED_URL)
244+
subpath.slice(key.length)), as defined in the ESM resolver.
245+
i. return fileURLToPath(RESOLVED_URL)
246246
3. return DIR/X
247247
```
248248

doc/node.1

+3-3
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,6 @@ Enable experimental JSON interop support for the ES Module loader.
122122
.It Fl -experimental-modules
123123
Enable experimental latest experimental modules features.
124124
.
125-
.It Fl -experimental-resolve-self
126-
Enable experimental support for a package to load itself.
127-
.
128125
.It Fl -experimental-policy
129126
Use the specified file as a security policy.
130127
.
@@ -138,6 +135,9 @@ Enable experimental
138135
.Sy diagnostic report
139136
feature.
140137
.
138+
.It Fl -experimental-resolve-self
139+
Enable experimental support for a package to load itself.
140+
.
141141
.It Fl -experimental-vm-modules
142142
Enable experimental ES module support in VM module.
143143
.

0 commit comments

Comments
 (0)