@@ -313,7 +313,7 @@ required filename with the added extensions: `.js`, `.json`, and finally
313313
314314` .js ` files are interpreted as JavaScript text files, and ` .json ` files are
315315parsed as JSON text files. ` .node ` files are interpreted as compiled addon
316- modules loaded with ` dlopen ` .
316+ modules loaded with ` process. dlopen() ` .
317317
318318A required module prefixed with ` '/' ` is an absolute path to the file. For
319319example, ` require('/home/marco/foo.js') ` will load the file at
@@ -527,6 +527,8 @@ added: v0.1.12
527527
528528<!-- type=var -->
529529
530+ * {Object}
531+
530532A reference to the ` module.exports ` that is shorter to type.
531533See the section about the [ exports shortcut] [ ] for details on when to use
532534` exports ` and when to use ` module.exports ` .
@@ -538,20 +540,21 @@ added: v0.1.16
538540
539541<!-- type=var -->
540542
541- * {Object }
543+ * {module }
542544
543545A reference to the current module, see the section about the
544546[ ` module ` object] [ ] . In particular, ` module.exports ` is used for defining what
545547a module exports and makes available through ` require() ` .
546548
547- ### require()
549+ ### require(id )
548550<!-- YAML
549551added: v0.1.13
550552-->
551553
552554<!-- type=var -->
553555
554- * {Function}
556+ * ` id ` {string} module name or path
557+ * Returns: {any} exported module content
555558
556559Used to import modules, ` JSON ` , and local files. Modules can be imported
557560from ` node_modules ` . Local modules and JSON files can be imported using
@@ -600,7 +603,7 @@ Process files with the extension `.sjs` as `.js`:
600603require .extensions [' .sjs' ] = require .extensions [' .js' ];
601604```
602605
603- ** Deprecated** In the past, this list has been used to load
606+ ** Deprecated. ** In the past, this list has been used to load
604607non-JavaScript modules into Node.js by compiling them on-demand.
605608However, in practice, there are much better ways to do this, such as
606609loading modules via some other Node.js program, or compiling them to
@@ -622,7 +625,7 @@ should be discouraged.
622625added: v0.1.17
623626-->
624627
625- * {Object }
628+ * {module }
626629
627630The ` Module ` object representing the entry script loaded when the Node.js
628631process launched.
@@ -676,7 +679,7 @@ changes:
676679Use the internal ` require() ` machinery to look up the location of a module,
677680but rather than loading the module, just return the resolved filename.
678681
679- #### require.resolve.paths(request)
682+ ##### require.resolve.paths(request)
680683<!-- YAML
681684added: v8.9.0
682685-->
@@ -820,7 +823,7 @@ added: v0.1.16
820823
821824* {string}
822825
823- The fully resolved filename to the module.
826+ The fully resolved filename of the module.
824827
825828### module.id
826829<!-- YAML
@@ -866,9 +869,9 @@ added: v0.5.1
866869-->
867870
868871* ` id ` {string}
869- * Returns: {Object} ` module.exports ` from the resolved module
872+ * Returns: {any} exported module content
870873
871- The ` module.require ` method provides a way to load a module as if
874+ The ` module.require() ` method provides a way to load a module as if
872875` require() ` was called from the original module.
873876
874877In order to do this, it is necessary to get a reference to the ` module ` object.
@@ -912,7 +915,7 @@ added: v10.12.0
912915
913916* ` filename ` {string} Filename to be used to construct the relative require
914917 function.
915- * Returns: {[ ` require ` ] [ ] } Require function
918+ * Returns: {require} Require function
916919
917920``` js
918921const { createRequireFromPath } = require (' module' );
@@ -922,13 +925,12 @@ const requireUtil = createRequireFromPath('../src/utils');
922925requireUtil (' ./some-tool' );
923926```
924927
928+ [ GLOBAL_FOLDERS ] : #modules_loading_from_the_global_folders
925929[ `Error` ] : errors.html#errors_class_error
926930[ `__dirname` ] : #modules_dirname
927931[ `__filename` ] : #modules_filename
928932[ `module` object ] : #modules_the_module_object
929933[ `path.dirname()` ] : path.html#path_path_dirname_path
930- [ `require` ] : #modules_require
931- [ GLOBAL_FOLDERS ] : #modules_loading_from_the_global_folders
932934[ exports shortcut ] : #modules_exports_shortcut
933935[ module resolution ] : #modules_all_together
934936[ module wrapper ] : #modules_the_module_wrapper
0 commit comments