Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: merge CJS and ESM docs #33512

Closed
wants to merge 11 commits into from
4 changes: 2 additions & 2 deletions doc/api/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -1517,11 +1517,11 @@ $ node --max-old-space-size=1536 index.js
[Subresource Integrity]: https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity
[V8 JavaScript code coverage]: https://v8project.blogspot.com/2017/12/javascript-code-coverage.html
[context-aware]: addons.html#addons_context_aware_addons
[customizing ESM specifier resolution]: esm.html#esm_customizing_esm_specifier_resolution_algorithm
[customizing ESM specifier resolution]: modules.html#modules_customizing_esm_specifier_resolution_algorithm
[debugger]: debugger.html
[debugging security implications]: https://nodejs.org/en/docs/guides/debugging-getting-started/#security-implications
[emit_warning]: process.html#process_process_emitwarning_warning_type_code_ctor
[experimental ECMAScript Module loader]: esm.html#esm_experimental_loaders
[experimental ECMAScript Module loader]: modules.html#modules_experimental_loaders
[jitless]: https://v8.dev/blog/jitless
[libuv threadpool documentation]: http://docs.libuv.org/en/latest/threadpool.html
[remote code execution]: https://www.owasp.org/index.php/Code_Injection
31 changes: 17 additions & 14 deletions doc/api/errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -1367,13 +1367,13 @@ An invalid or unknown file encoding was passed.
<a id="ERR_INVALID_PACKAGE_CONFIG"></a>
### `ERR_INVALID_PACKAGE_CONFIG`

An invalid `package.json` file was found which failed parsing.
An invalid [`package.json`][] file was found which failed parsing.

<a id="ERR_INVALID_PACKAGE_TARGET"></a>
### `ERR_INVALID_PACKAGE_TARGET`

The `package.json` [exports][] field contains an invalid target mapping value
for the attempted module resolution.
The [`package.json`][] [`"exports"`][] field contains an invalid target mapping
value for the attempted module resolution.

<a id="ERR_INVALID_PERFORMANCE_MARK"></a>
### `ERR_INVALID_PERFORMANCE_MARK`
Expand Down Expand Up @@ -1684,9 +1684,10 @@ A given value is out of the accepted range.
<a id="ERR_PACKAGE_PATH_NOT_EXPORTED"></a>
### `ERR_PACKAGE_PATH_NOT_EXPORTED`

The `package.json` [exports][] field does not export the requested subpath.
Because exports are encapsulated, private internal modules that are not exported
cannot be imported through the package resolution, unless using an absolute URL.
The [`package.json`][] [`"exports"`][] field does not export the requested
subpath. Because exports are encapsulated, private internal modules that are not
exported cannot be imported through the package resolution, unless using an
absolute URL.

<a id="ERR_PROTO_ACCESS"></a>
### `ERR_PROTO_ACCESS`
Expand Down Expand Up @@ -2050,7 +2051,7 @@ signal (such as [`subprocess.kill()`][]).

`import` a directory URL is unsupported. Instead, you can
[self-reference a package using its name][] and [define a custom subpath][] in
the `"exports"` field of the `package.json` file.
the [`"exports"`][] field of the [`package.json`][] file.

<!-- eslint-skip -->
```js
Expand Down Expand Up @@ -2471,11 +2472,11 @@ releases.
> Stability: 1 - Experimental

The `--entry-type=commonjs` flag was used to attempt to execute an `.mjs` file
or a `.js` file where the nearest parent `package.json` contains
or a `.js` file where the nearest parent [`package.json`][] contains
`"type": "module"`; or
the `--entry-type=module` flag was used to attempt to execute a `.cjs` file or
a `.js` file where the nearest parent `package.json` either lacks a `"type"`
field or contains `"type": "commonjs"`.
a `.js` file where the nearest parent [`package.json`][] either lacks a
[`"type"`][] field or contains `"type": "commonjs"`.

<a id="ERR_FS_WATCHER_ALREADY_STARTED"></a>
#### `ERR_FS_WATCHER_ALREADY_STARTED`
Expand Down Expand Up @@ -2601,7 +2602,7 @@ such as `process.stdout.on('data')`.
[`subprocess.send()`]: child_process.html#child_process_subprocess_send_message_sendhandle_options_callback
[`util.getSystemErrorName(error.errno)`]: util.html#util_util_getsystemerrorname_err
[`zlib`]: zlib.html
[ES Module]: esm.html
[ES Module]: modules.html
[ICU]: intl.html#intl_internationalization_support
[Node.js Error Codes]: #nodejs-error-codes
[V8's stack trace API]: https://github.com/v8/v8/wiki/Stack-Trace-API
Expand All @@ -2610,13 +2611,15 @@ such as `process.stdout.on('data')`.
[crypto digest algorithm]: crypto.html#crypto_crypto_gethashes
[domains]: domain.html
[event emitter-based]: events.html#events_class_eventemitter
[exports]: esm.html#esm_package_entry_points
[`"exports"`]: modules.html#modules_exports_1
[`"type"`]: modules.html#modules_type
[`package.json`]: modules.html#modules_package_json_file
[file descriptors]: https://en.wikipedia.org/wiki/File_descriptor
[policy]: policy.html
[stream-based]: stream.html
[syscall]: http://man7.org/linux/man-pages/man2/syscalls.2.html
[Subresource Integrity specification]: https://www.w3.org/TR/SRI/#the-integrity-attribute
[try-catch]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/try...catch
[vm]: vm.html
[self-reference a package using its name]: esm.html#esm_self_referencing_a_package_using_its_name
[define a custom subpath]: esm.html#esm_subpath_exports
[self-reference a package using its name]: modules.html#modules_self_referencing_a_package_using_its_name
[define a custom subpath]: modules.html#modules_subpath_exports