Skip to content

Commit c328e58

Browse files
watsonMylesBorins
authored andcommitted
doc: improve module.builtinModules documentation
PR-URL: #17712 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Jon Moss <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent b44f245 commit c328e58

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

doc/api/modules.md

+8
Original file line numberDiff line numberDiff line change
@@ -841,11 +841,19 @@ added: v9.3.0
841841
A list of the names of all modules provided by Node.js. Can be used to verify
842842
if a module is maintained by a third-party module or not.
843843

844+
Note that `module` in this context isn't the same object that's provided
845+
by the [module wrapper][]. To access it, require the `Module` module:
846+
847+
```js
848+
const builtin = require('module').builtinModules;
849+
```
850+
844851
[`__dirname`]: #modules_dirname
845852
[`__filename`]: #modules_filename
846853
[`Error`]: errors.html#errors_class_error
847854
[`module` object]: #modules_the_module_object
848855
[`path.dirname()`]: path.html#path_path_dirname_path
849856
[exports shortcut]: #modules_exports_shortcut
850857
[module resolution]: #modules_all_together
858+
[module wrapper]: #modules_the_module_wrapper
851859
[native addons]: addons.html

0 commit comments

Comments
 (0)