Skip to content

Commit

Permalink
doc: update module.builtinModules sentence
Browse files Browse the repository at this point in the history
updates the sentence saying that `module.builtinModule`
only contains the modules that can be loaded without
`node:` (since v23.5.0 also prefix-only modules are
included in the list)

PR-URL: #57089
Refs: #56185
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Jordan Harband <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
  • Loading branch information
dario-piotrowicz authored and targos committed Feb 17, 2025
1 parent f4a82fd commit ed5671f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions doc/api/modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -511,9 +511,11 @@ by that name.

Some built-in modules are always preferentially loaded if their identifier is
passed to `require()`. For instance, `require('http')` will always
return the built-in HTTP module, even if there is a file by that name. The list
of built-in modules that can be loaded without using the `node:` prefix is exposed
in [`module.builtinModules`][], listed without the prefix.
return the built-in HTTP module, even if there is a file by that name.

The list of all the built-in modules can be retrieved from [`module.builtinModules`][].
The modules being all listed without the `node:` prefix, except those that mandate such
prefix (as explained in the next section).

### Built-in modules with mandatory `node:` prefix

Expand Down

0 comments on commit ed5671f

Please sign in to comment.