diff --git a/doc/api/modules.md b/doc/api/modules.md index 6e8f703e5fd546..a633ac7c9ceb93 100644 --- a/doc/api/modules.md +++ b/doc/api/modules.md @@ -331,15 +331,17 @@ described in greater detail elsewhere in this documentation. The core modules are defined within the Node.js source and are located in the `lib/` folder. -Core 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. - -Core modules can also be identified using the `node:` prefix, in which case +Core modules can be identified using the `node:` prefix, in which case it bypasses the `require` cache. For instance, `require('node:http')` will always return the built in HTTP module, even if there is `require.cache` entry by that name. +Some core 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 core modules that can be loaded without using the `node:` prefix is exposed +as [`module.builtinModules`][]. + ## Cycles @@ -1088,6 +1090,7 @@ This section was moved to [`__dirname`]: #__dirname [`__filename`]: #__filename [`import()`]: https://wiki.developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import#Dynamic_Imports +[`module.builtinModules`]: module.md#modulebuiltinmodules [`module.children`]: #modulechildren [`module.id`]: #moduleid [`module` core module]: module.md