doc: improve module.builtinModules documentation
In this PR I've kept the original casing of the object module
, but I think it might be easier to understand if we changed the entire section to use the uppercase version: Module
. This have two benefits:
- It matches what's actually exported when requiring "module"
- It's easier to distinguish from the other
module
object that's available by default to all file modules
That change would instead look like this:
-### module.builtinModules
+### Module.builtinModules
<!-- YAML
added: v9.3.0
-->
* {string[]}
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
+available by default inside file modules. To access it you need to
+require the `Module` module:
+
+```js
+const Module = require('module');
+
+const builtin = Module.builtinModules;
+```
+
Checklist
-
documentation is changed or added -
commit message follows commit guidelines
Affected core subsystem(s)
- doc