| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -132,7 +132,7 @@ variable. Since the module lookups using `node_modules` folders are all | |||
| 132 | 132 | relative, and based on the real path of the files making the calls to | |
| 133 | 133 | `require()`, the packages themselves can be anywhere. | |
| 134 | 134 | ||
| 135 | - ## Addenda: The .mjs extension | ||
| 135 | + ## Addenda: The `.mjs` extension | ||
| 136 | 136 | ||
| 137 | 137 | It is not possible to `require()` files that have the `.mjs` extension. | |
| 138 | 138 | Attempting to do so will throw [an error][]. The `.mjs` extension is | |
@@ -518,7 +518,7 @@ the module rather than the global object. | |||
| 518 | 518 | ||
| 519 | 519 | ## The module scope | |
| 520 | 520 | ||
| 521 | - ### \_\_dirname | ||
| 521 | + ### `__dirname` | ||
| 522 | 522 | <!-- YAML | |
| 523 | 523 | added: v0.1.27 | |
| 524 | 524 | --> | |
@@ -539,7 +539,7 @@ console.log(path.dirname(__filename)); | |||
| 539 | 539 | // Prints: /Users/mjr | |
| 540 | 540 | ``` | |
| 541 | 541 | ||
| 542 | - ### \_\_filename | ||
| 542 | + ### `__filename` | ||
| 543 | 543 | <!-- YAML | |
| 544 | 544 | added: v0.0.1 | |
| 545 | 545 | --> | |
@@ -577,7 +577,7 @@ References to `__filename` within `b.js` will return | |||
| 577 | 577 | `/Users/mjr/app/node_modules/b/b.js` while references to `__filename` within | |
| 578 | 578 | `a.js` will return `/Users/mjr/app/a.js`. | |
| 579 | 579 | ||
| 580 | - ### exports | ||
| 580 | + ### `exports` | ||
| 581 | 581 | <!-- YAML | |
| 582 | 582 | added: v0.1.12 | |
| 583 | 583 | --> | |
@@ -590,7 +590,7 @@ A reference to the `module.exports` that is shorter to type. | |||
| 590 | 590 | See the section about the [exports shortcut][] for details on when to use | |
| 591 | 591 | `exports` and when to use `module.exports`. | |
| 592 | 592 | ||
| 593 | - ### module | ||
| 593 | + ### `module` | ||
| 594 | 594 | <!-- YAML | |
| 595 | 595 | added: v0.1.16 | |
| 596 | 596 | --> | |
@@ -603,7 +603,7 @@ A reference to the current module, see the section about the | |||
| 603 | 603 | [`module` object][]. In particular, `module.exports` is used for defining what | |
| 604 | 604 | a module exports and makes available through `require()`. | |
| 605 | 605 | ||
| 606 | - ### require(id) | ||
| 606 | + ### `require(id)` | ||
| 607 | 607 | <!-- YAML | |
| 608 | 608 | added: v0.1.13 | |
| 609 | 609 | --> | |
@@ -630,7 +630,7 @@ const jsonData = require('./path/filename.json'); | |||
| 630 | 630 | const crypto = require('crypto'); | |
| 631 | 631 | ``` | |
| 632 | 632 | ||
| 633 | - #### require.cache | ||
| 633 | + #### `require.cache` | ||
| 634 | 634 | <!-- YAML | |
| 635 | 635 | added: v0.3.0 | |
| 636 | 636 | --> | |
@@ -647,7 +647,7 @@ native modules and if a name matching a native module is added to the cache, | |||
| 647 | 647 | no require call is | |
| 648 | 648 | going to receive the native module anymore. Use with care! | |
| 649 | 649 | ||
| 650 | - #### require.extensions | ||
| 650 | + #### `require.extensions` | ||
| 651 | 651 | <!-- YAML | |
| 652 | 652 | added: v0.3.0 | |
| 653 | 653 | deprecated: v0.10.6 | |
@@ -673,7 +673,7 @@ program, or compiling them to JavaScript ahead of time. | |||
| 673 | 673 | Avoid using `require.extensions`. Use could cause subtle bugs and resolving the | |
| 674 | 674 | extensions gets slower with each registered extension. | |
| 675 | 675 | ||
| 676 | - #### require.main | ||
| 676 | + #### `require.main` | ||
| 677 | 677 | <!-- YAML | |
| 678 | 678 | added: v0.1.17 | |
| 679 | 679 | --> | |
@@ -710,7 +710,7 @@ Module { | |||
| 710 | 710 | '/node_modules' ] } | |
| 711 | 711 | ``` | |
| 712 | 712 | ||
| 713 | - #### require.resolve(request\[, options\]) | ||
| 713 | + #### `require.resolve(request[, options])` | ||
| 714 | 714 | <!-- YAML | |
| 715 | 715 | added: v0.3.0 | |
| 716 | 716 | changes: | |
@@ -732,7 +732,7 @@ changes: | |||
| 732 | 732 | Use the internal `require()` machinery to look up the location of a module, | |
| 733 | 733 | but rather than loading the module, just return the resolved filename. | |
| 734 | 734 | ||
| 735 | - ##### require.resolve.paths(request) | ||
| 735 | + ##### `require.resolve.paths(request)` | ||
| 736 | 736 | <!-- YAML | |
| 737 | 737 | added: v8.9.0 | |
| 738 | 738 | --> | |
@@ -759,7 +759,7 @@ representing the current module. For convenience, `module.exports` is | |||
| 759 | 759 | also accessible via the `exports` module-global. `module` is not actually | |
| 760 | 760 | a global but rather local to each module. | |
| 761 | 761 | ||
| 762 | - ### module.children | ||
| 762 | + ### `module.children` | ||
| 763 | 763 | <!-- YAML | |
| 764 | 764 | added: v0.1.16 | |
| 765 | 765 | --> | |
@@ -768,7 +768,7 @@ added: v0.1.16 | |||
| 768 | 768 | ||
| 769 | 769 | The module objects required for the first time by this one. | |
| 770 | 770 | ||
| 771 | - ### module.exports | ||
| 771 | + ### `module.exports` | ||
| 772 | 772 | <!-- YAML | |
| 773 | 773 | added: v0.1.16 | |
| 774 | 774 | --> | |
@@ -822,7 +822,7 @@ const x = require('./x'); | |||
| 822 | 822 | console.log(x.a); | |
| 823 | 823 | ``` | |
| 824 | 824 | ||
| 825 | - #### exports shortcut | ||
| 825 | + #### `exports` shortcut | ||
| 826 | 826 | <!-- YAML | |
| 827 | 827 | added: v0.1.16 | |
| 828 | 828 | --> | |
@@ -869,7 +869,7 @@ function require(/* ... */) { | |||
| 869 | 869 | } | |
| 870 | 870 | ``` | |
| 871 | 871 | ||
| 872 | - ### module.filename | ||
| 872 | + ### `module.filename` | ||
| 873 | 873 | <!-- YAML | |
| 874 | 874 | added: v0.1.16 | |
| 875 | 875 | --> | |
@@ -878,7 +878,7 @@ added: v0.1.16 | |||
| 878 | 878 | ||
| 879 | 879 | The fully resolved filename of the module. | |
| 880 | 880 | ||
| 881 | - ### module.id | ||
| 881 | + ### `module.id` | ||
| 882 | 882 | <!-- YAML | |
| 883 | 883 | added: v0.1.16 | |
| 884 | 884 | --> | |
@@ -888,7 +888,7 @@ added: v0.1.16 | |||
| 888 | 888 | The identifier for the module. Typically this is the fully resolved | |
| 889 | 889 | filename. | |
| 890 | 890 | ||
| 891 | - ### module.loaded | ||
| 891 | + ### `module.loaded` | ||
| 892 | 892 | <!-- YAML | |
| 893 | 893 | added: v0.1.16 | |
| 894 | 894 | --> | |
@@ -898,7 +898,7 @@ added: v0.1.16 | |||
| 898 | 898 | Whether or not the module is done loading, or is in the process of | |
| 899 | 899 | loading. | |
| 900 | 900 | ||
| 901 | - ### module.parent | ||
| 901 | + ### `module.parent` | ||
| 902 | 902 | <!-- YAML | |
| 903 | 903 | added: v0.1.16 | |
| 904 | 904 | --> | |
@@ -907,7 +907,7 @@ added: v0.1.16 | |||
| 907 | 907 | ||
| 908 | 908 | The module that first required this one. | |
| 909 | 909 | ||
| 910 | - ### module.paths | ||
| 910 | + ### `module.paths` | ||
| 911 | 911 | <!-- YAML | |
| 912 | 912 | added: v0.4.0 | |
| 913 | 913 | --> | |
@@ -916,7 +916,7 @@ added: v0.4.0 | |||
| 916 | 916 | ||
| 917 | 917 | The search paths for the module. | |
| 918 | 918 | ||
| 919 | - ### module.require(id) | ||
| 919 | + ### `module.require(id)` | ||
| 920 | 920 | <!-- YAML | |
| 921 | 921 | added: v0.5.1 | |
| 922 | 922 | --> | |
@@ -944,7 +944,7 @@ Provides general utility methods when interacting with instances of | |||
| 944 | 944 | `Module` — the `module` variable often seen in file modules. Accessed | |
| 945 | 945 | via `require('module')`. | |
| 946 | 946 | ||
| 947 | - ### module.builtinModules | ||
| 947 | + ### `module.builtinModules` | ||
| 948 | 948 | <!-- YAML | |
| 949 | 949 | added: | |
| 950 | 950 | - v9.3.0 | |
@@ -964,7 +964,7 @@ by the [module wrapper][]. To access it, require the `Module` module: | |||
| 964 | 964 | const builtin = require('module').builtinModules; | |
| 965 | 965 | ``` | |
| 966 | 966 | ||
| 967 | - ### module.createRequire(filename) | ||
| 967 | + ### `module.createRequire(filename)` | ||
| 968 | 968 | <!-- YAML | |
| 969 | 969 | added: v12.2.0 | |
| 970 | 970 | --> | |
@@ -982,7 +982,7 @@ const require = createRequire(import.meta.url); | |||
| 982 | 982 | const siblingModule = require('./sibling-module'); | |
| 983 | 983 | ``` | |
| 984 | 984 | ||
| 985 | - ### module.createRequireFromPath(filename) | ||
| 985 | + ### `module.createRequireFromPath(filename)` | ||
| 986 | 986 | <!-- YAML | |
| 987 | 987 | added: v10.12.0 | |
| 988 | 988 | deprecated: v12.2.0 | |
@@ -1002,7 +1002,7 @@ const requireUtil = createRequireFromPath('../src/utils/'); | |||
| 1002 | 1002 | requireUtil('./some-tool'); | |
| 1003 | 1003 | ``` | |
| 1004 | 1004 | ||
| 1005 | - ### module.syncBuiltinESMExports() | ||
| 1005 | + ### `module.syncBuiltinESMExports()` | ||
| 1006 | 1006 | <!-- YAML | |
| 1007 | 1007 | added: v12.12.0 | |
| 1008 | 1008 | --> | |
| Back | FazBrowse Home | New Git URL |
0 commit comments