node/doc/api
Joyee Cheung 943b1edb3c
doc: correct module loading descriptions
The existing description is outdated, and exposes too many details
that are subject to change.

- There is no point conceptualizing "two module loaders", in reality
  the boundary is blurred since the two invoke each other to support
  require(esm) and import(cjs). The distinction lies not in
  what kind of module is being requested/which loader is used, but
  only in how the the module request is initiated (via `require()`
  or `import()`). The inner working of the loaders are subject
  to change and not suitable to be documented.
- It should not mention monkey patching in the documentation, as
  publicly supported universal hooks are already provided through
  `module.registerHooks()`, and so there's no need to single out
  any of them in terms of loader hooks support either.
- Remove the description about whether they are asynchronous or
  synchronous, which is also implementation detail subject to change.
- Add missing descriptions about how .ts, .mts and .cts are treated,
  and `.node` is also supported in import now.
- There is no need to specially mention .node treatment in cli.md,
  link to the explanations about loading from `import` in packages.md
  instead.

PR-URL: https://github.com/nodejs/node/pull/60346
Reviewed-By: Jacob Smith <jacob@frende.me>
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
2025-10-31 20:30:23 +00:00
..
addons.md doc,src,test: replace use of deprecated GetIsolate 2025-10-04 18:48:35 +02:00
assert.md 2025-10-28, Version 25.1.0 (Current) 2025-10-28 20:03:00 +01:00
async_context.md doc: fix typed list formatting 2025-07-15 17:18:42 +00:00
async_hooks.md doc,tools: enforce use of node: prefix 2024-07-21 15:44:27 +00:00
buffer.md doc: fix blob.bytes() heading level 2025-10-16 08:17:53 +00:00
child_process.md doc: fix typo on child_process.md 2025-10-06 09:11:55 +00:00
cli.md doc: correct module loading descriptions 2025-10-31 20:30:23 +00:00
cluster.md doc: fix typed list formatting 2025-07-15 17:18:42 +00:00
console.md 2025-10-08, Version 24.10.0 (Current) 2025-10-08 19:44:10 -03:00
crypto.md doc,crypto: reorder ML-KEM in the asymmetric key types table 2025-10-01 12:25:45 +00:00
debugger.md inspector: introduce the --inspect-wait flag 2024-05-11 18:48:30 +00:00
deprecations.md doc: mention more codemods in deprecations.md 2025-10-27 14:54:31 +01:00
dgram.md 2025-06-09, Version 24.2.0 (Current) 2025-06-09 23:45:29 +02:00
diagnostics_channel.md 2025-09-24, Version 22.20.0 'Jod' (LTS) 2025-09-24 13:04:16 +00:00
dns.md doc: add missing CAA type to dns.resolveAny() & dnsPromises.resolveAny() 2025-10-22 18:43:07 +00:00
documentation.md doc: clarify release candidate stability index 2025-08-02 10:58:21 +00:00
domain.md doc: fix typed list formatting 2025-07-15 17:18:42 +00:00
embedding.md doc: improve c++ embedder API doc 2024-11-01 03:43:53 +00:00
environment_variables.md doc: mark .env files support as stable 2025-10-03 15:43:10 +02:00
errors.md doc: disambiguate top-level worker_threads module exports 2025-10-10 12:17:12 +00:00
esm.md doc: rephrase dynamic import() description 2025-09-12 06:40:24 +00:00
events.md doc: format safely for doc-kit 2025-07-28 20:03:37 +00:00
fs.md 2025-10-15, Version 25.0.0 (Current) 2025-10-15 13:27:47 -03:00
globals.md doc: mention more codemods in deprecations.md 2025-10-27 14:54:31 +01:00
http.md 2025-10-28, Version 25.1.0 (Current) 2025-10-28 20:03:00 +01:00
http2.md 2025-09-24, Version 22.20.0 'Jod' (LTS) 2025-09-24 13:04:16 +00:00
https.md 2025-10-20, Version 22.21.0 'Jod' (LTS) 2025-10-21 01:45:50 +02:00
index.md doc: add new environment variables doc page 2025-07-20 20:53:54 +00:00
inspector.md 2025-08-28, Version 22.19.0 'Jod' (LTS) 2025-08-28 23:08:02 +02:00
intl.md doc: improve documentation about ICU data fallback 2023-09-22 13:24:23 +00:00
module.md doc, module: change async customization hooks to experimental 2025-10-22 14:43:22 +00:00
modules.md doc: format safely for doc-kit 2025-07-28 20:03:37 +00:00
n-api.md node-api: add napi_create_object_with_properties 2025-10-30 14:10:44 +00:00
net.md 2025-08-28, Version 22.19.0 'Jod' (LTS) 2025-08-28 23:08:02 +02:00
os.md doc: fix typed list formatting 2025-07-15 17:18:42 +00:00
packages.md doc: correct module loading descriptions 2025-10-31 20:30:23 +00:00
path.md 2025-09-24, Version 22.20.0 'Jod' (LTS) 2025-09-24 13:04:16 +00:00
perf_hooks.md perf_hooks: move non-standard performance properties to perf_hooks 2025-10-28 00:23:50 +01:00
permissions.md src,permission: add --allow-inspector ability 2025-09-11 20:10:02 +00:00
process.md 2025-10-20, Version 22.21.0 'Jod' (LTS) 2025-10-21 01:45:50 +02:00
punycode.md doc: fix typed list formatting 2025-07-15 17:18:42 +00:00
querystring.md doc: get rid of unnecessary eslint-skip comments 2023-11-22 19:03:33 +00:00
quic.md doc: fix quic session instance typo 2025-08-29 02:24:57 +00:00
readline.md doc: fix typed list formatting 2025-07-15 17:18:42 +00:00
repl.md doc: fix typed list formatting 2025-07-15 17:18:42 +00:00
report.md 2025-01-07, Version 22.13.0 'Jod' (LTS) 2025-01-07 14:36:47 -05:00
single-executable-applications.md 2025-09-24, Version 22.20.0 'Jod' (LTS) 2025-09-24 13:04:16 +00:00
sqlite.md sqlite,doc: fix StatementSync section 2025-10-31 02:46:05 +00:00
stream.md lib: fix isReadable and isWritable return type value 2025-09-07 14:50:36 +00:00
string_decoder.md doc: add esm examples to node:string_decoder 2024-10-26 20:36:25 +00:00
synopsis.md doc: clarify explaination text on how to run the example 2023-10-06 13:37:31 +00:00
test.md 2025-09-24, Version 22.20.0 'Jod' (LTS) 2025-09-24 13:04:16 +00:00
timers.md 2025-06-09, Version 24.2.0 (Current) 2025-06-09 23:45:29 +02:00
tls.md doc: update OpenSSL default security level to 2 2025-09-08 07:57:40 +00:00
tracing.md doc: fix typed list formatting 2025-07-15 17:18:42 +00:00
tty.md doc: fix typed list formatting 2025-07-15 17:18:42 +00:00
typescript.md doc: update decorator documentation to reflect actual policy 2025-10-19 08:34:28 +00:00
url.md doc: mention more codemods in deprecations.md 2025-10-27 14:54:31 +01:00
util.md 2025-10-20, Version 22.21.0 'Jod' (LTS) 2025-10-21 01:45:50 +02:00
v8.md 2025-10-15, Version 25.0.0 (Current) 2025-10-15 13:27:47 -03:00
vm.md 2025-10-20, Version 22.21.0 'Jod' (LTS) 2025-10-21 01:45:50 +02:00
wasi.md doc: fix typed list formatting 2025-07-15 17:18:42 +00:00
webcrypto.md doc,crypto: update subtle.generateKey and subtle.importKey 2025-09-13 08:55:17 +00:00
webstreams.md 2025-09-24, Version 22.20.0 'Jod' (LTS) 2025-09-24 13:04:16 +00:00
worker_threads.md perf_hooks: move non-standard performance properties to perf_hooks 2025-10-28 00:23:50 +01:00
zlib.md doc: add missing Zstd strategy constants 2025-08-19 18:38:44 +00:00