Skip to content

Commit 5687a31

Browse files
vsemozhetbytBethGriggs
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 71a3f48 commit 5687a31

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
-->
@@ -1377,17 +1377,17 @@ greater than `4` (its current default value). For more information, see the
13771377
[`tls.DEFAULT_MIN_VERSION`]: tls.html#tls_tls_default_min_version
13781378
[`unhandledRejection`]: process.html#process_event_unhandledrejection
13791379
[Chrome DevTools Protocol]: https://chromedevtools.github.io/devtools-protocol/
1380+
[Conditional Exports]: esm.html#esm_conditional_exports
13801381
[REPL]: repl.html
13811382
[ScriptCoverage]: https://chromedevtools.github.io/devtools-protocol/tot/Profiler#type-ScriptCoverage
13821383
[Source Map]: https://sourcemaps.info/spec.html
13831384
[Subresource Integrity]: https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity
13841385
[V8 JavaScript code coverage]: https://v8project.blogspot.com/2017/12/javascript-code-coverage.html
1385-
[customizing esm specifier resolution]: esm.html#esm_customizing_esm_specifier_resolution_algorithm
1386+
[context-aware]: addons.html#addons_context_aware_addons
1387+
[customizing ESM specifier resolution]: esm.html#esm_customizing_esm_specifier_resolution_algorithm
13861388
[debugger]: debugger.html
13871389
[debugging security implications]: https://nodejs.org/en/docs/guides/debugging-getting-started/#security-implications
13881390
[emit_warning]: process.html#process_process_emitwarning_warning_type_code_ctor
13891391
[experimental ECMAScript Module]: esm.html#esm_resolve_hook
13901392
[libuv threadpool documentation]: http://docs.libuv.org/en/latest/threadpool.html
13911393
[remote code execution]: https://www.owasp.org/index.php/Code_Injection
1392-
[context-aware]: addons.html#addons_context_aware_addons
1393-
[Conditional Exports]: esm.html#esm_conditional_exports

doc/api/esm.md

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

630630
```js
631-
import date from 'date';
632-
const someDate = new date();
633-
// someDate contains state; date does not
631+
import Date from 'date';
632+
const someDate = new Date();
633+
// someDate contains state; Date does not
634634
```
635635

636636
The `new` keyword isn’t required; a package’s function can return a new
@@ -1221,7 +1221,7 @@ _defaultEnv_ is the conditional environment name priority array,
12211221
> 1. Throw a _Module Not Found_ error.
12221222
> 1. If _pjson.exports_ is not **null** or **undefined**, then
12231223
> 1. If _exports_ is an Object with both a key starting with _"."_ and a key
1224-
> not starting with _"."_, throw a "Invalid Package Configuration" error.
1224+
> not starting with _"."_, throw an "Invalid Package Configuration" error.
12251225
> 1. If _pjson.exports_ is a String or Array, or an Object containing no
12261226
> keys starting with _"."_, then
12271227
> 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 ES module support and caching modules.
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)