summaryrefslogtreecommitdiff
path: root/doc/api/modules.md
diff options
context:
space:
mode:
authorThomas Watson <w@tson.dk>2017-12-16 18:36:00 +0100
committerJon Moss <me@jonathanmoss.me>2017-12-22 09:09:42 -0500
commitf4ab20412f459cfbfaacf14bbd5235bca13e4c57 (patch)
tree8a382ce325c6e26f4cefc20e01fa6d216deec452 /doc/api/modules.md
parent4dc930147eb58ab889f5788ae6977d0dbc1c2dbc (diff)
downloadnode-new-f4ab20412f459cfbfaacf14bbd5235bca13e4c57.tar.gz
doc: improve module.builtinModules documentation
PR-URL: https://github.com/nodejs/node/pull/17712 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Jon Moss <me@jonathanmoss.me> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'doc/api/modules.md')
-rw-r--r--doc/api/modules.md8
1 files changed, 8 insertions, 0 deletions
diff --git a/doc/api/modules.md b/doc/api/modules.md
index 16c01f66fa..73fd9a2842 100644
--- a/doc/api/modules.md
+++ b/doc/api/modules.md
@@ -841,6 +841,13 @@ added: v9.3.0
A list of the names of all modules provided by Node.js. Can be used to verify
if a module is maintained by a third-party module or not.
+Note that `module` in this context isn't the same object that's provided
+by the [module wrapper][]. To access it, require the `Module` module:
+
+```js
+const builtin = require('module').builtinModules;
+```
+
[`__dirname`]: #modules_dirname
[`__filename`]: #modules_filename
[`Error`]: errors.html#errors_class_error
@@ -848,4 +855,5 @@ if a module is maintained by a third-party module or not.
[`path.dirname()`]: path.html#path_path_dirname_path
[exports shortcut]: #modules_exports_shortcut
[module resolution]: #modules_all_together
+[module wrapper]: #modules_the_module_wrapper
[native addons]: addons.html