| 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 | |
@@ -504,7 +504,7 @@ the module rather than the global object. | |||
| 504 | 504 | ||
| 505 | 505 | ## The module scope | |
| 506 | 506 | ||
| 507 | - ### \_\_dirname | ||
| 507 | + ### `__dirname` | ||
| 508 | 508 | <!-- YAML | |
| 509 | 509 | added: v0.1.27 | |
| 510 | 510 | --> | |
@@ -525,7 +525,7 @@ console.log(path.dirname(__filename)); | |||
| 525 | 525 | // Prints: /Users/mjr | |
| 526 | 526 | ``` | |
| 527 | 527 | ||
| 528 | - ### \_\_filename | ||
| 528 | + ### `__filename` | ||
| 529 | 529 | <!-- YAML | |
| 530 | 530 | added: v0.0.1 | |
| 531 | 531 | --> | |
@@ -563,7 +563,7 @@ References to `__filename` within `b.js` will return | |||
| 563 | 563 | `/Users/mjr/app/node_modules/b/b.js` while references to `__filename` within | |
| 564 | 564 | `a.js` will return `/Users/mjr/app/a.js`. | |
| 565 | 565 | ||
| 566 | - ### exports | ||
| 566 | + ### `exports` | ||
| 567 | 567 | <!-- YAML | |
| 568 | 568 | added: v0.1.12 | |
| 569 | 569 | --> | |
@@ -576,7 +576,7 @@ A reference to the `module.exports` that is shorter to type. | |||
| 576 | 576 | See the section about the [exports shortcut][] for details on when to use | |
| 577 | 577 | `exports` and when to use `module.exports`. | |
| 578 | 578 | ||
| 579 | - ### module | ||
| 579 | + ### `module` | ||
| 580 | 580 | <!-- YAML | |
| 581 | 581 | added: v0.1.16 | |
| 582 | 582 | --> | |
@@ -589,7 +589,7 @@ A reference to the current module, see the section about the | |||
| 589 | 589 | [`module` object][]. In particular, `module.exports` is used for defining what | |
| 590 | 590 | a module exports and makes available through `require()`. | |
| 591 | 591 | ||
| 592 | - ### require(id) | ||
| 592 | + ### `require(id)` | ||
| 593 | 593 | <!-- YAML | |
| 594 | 594 | added: v0.1.13 | |
| 595 | 595 | --> | |
@@ -616,7 +616,7 @@ const jsonData = require('./path/filename.json'); | |||
| 616 | 616 | const crypto = require('crypto'); | |
| 617 | 617 | ``` | |
| 618 | 618 | ||
| 619 | - #### require.cache | ||
| 619 | + #### `require.cache` | ||
| 620 | 620 | <!-- YAML | |
| 621 | 621 | added: v0.3.0 | |
| 622 | 622 | --> | |
@@ -633,7 +633,7 @@ native modules and if a name matching a native module is added to the cache, | |||
| 633 | 633 | no require call is | |
| 634 | 634 | going to receive the native module anymore. Use with care! | |
| 635 | 635 | ||
| 636 | - #### require.extensions | ||
| 636 | + #### `require.extensions` | ||
| 637 | 637 | <!-- YAML | |
| 638 | 638 | added: v0.3.0 | |
| 639 | 639 | deprecated: v0.10.6 | |
@@ -659,7 +659,7 @@ program, or compiling them to JavaScript ahead of time. | |||
| 659 | 659 | Avoid using `require.extensions`. Use could cause subtle bugs and resolving the | |
| 660 | 660 | extensions gets slower with each registered extension. | |
| 661 | 661 | ||
| 662 | - #### require.main | ||
| 662 | + #### `require.main` | ||
| 663 | 663 | <!-- YAML | |
| 664 | 664 | added: v0.1.17 | |
| 665 | 665 | --> | |
@@ -696,7 +696,7 @@ Module { | |||
| 696 | 696 | '/node_modules' ] } | |
| 697 | 697 | ``` | |
| 698 | 698 | ||
| 699 | - #### require.resolve(request\[, options\]) | ||
| 699 | + #### `require.resolve(request[, options])` | ||
| 700 | 700 | <!-- YAML | |
| 701 | 701 | added: v0.3.0 | |
| 702 | 702 | changes: | |
@@ -718,7 +718,7 @@ changes: | |||
| 718 | 718 | Use the internal `require()` machinery to look up the location of a module, | |
| 719 | 719 | but rather than loading the module, just return the resolved filename. | |
| 720 | 720 | ||
| 721 | - ##### require.resolve.paths(request) | ||
| 721 | + ##### `require.resolve.paths(request)` | ||
| 722 | 722 | <!-- YAML | |
| 723 | 723 | added: v8.9.0 | |
| 724 | 724 | --> | |
@@ -745,7 +745,7 @@ representing the current module. For convenience, `module.exports` is | |||
| 745 | 745 | also accessible via the `exports` module-global. `module` is not actually | |
| 746 | 746 | a global but rather local to each module. | |
| 747 | 747 | ||
| 748 | - ### module.children | ||
| 748 | + ### `module.children` | ||
| 749 | 749 | <!-- YAML | |
| 750 | 750 | added: v0.1.16 | |
| 751 | 751 | --> | |
@@ -754,7 +754,7 @@ added: v0.1.16 | |||
| 754 | 754 | ||
| 755 | 755 | The module objects required for the first time by this one. | |
| 756 | 756 | ||
| 757 | - ### module.exports | ||
| 757 | + ### `module.exports` | ||
| 758 | 758 | <!-- YAML | |
| 759 | 759 | added: v0.1.16 | |
| 760 | 760 | --> | |
@@ -808,7 +808,7 @@ const x = require('./x'); | |||
| 808 | 808 | console.log(x.a); | |
| 809 | 809 | ``` | |
| 810 | 810 | ||
| 811 | - #### exports shortcut | ||
| 811 | + #### `exports` shortcut | ||
| 812 | 812 | <!-- YAML | |
| 813 | 813 | added: v0.1.16 | |
| 814 | 814 | --> | |
@@ -855,7 +855,7 @@ function require(/* ... */) { | |||
| 855 | 855 | } | |
| 856 | 856 | ``` | |
| 857 | 857 | ||
| 858 | - ### module.filename | ||
| 858 | + ### `module.filename` | ||
| 859 | 859 | <!-- YAML | |
| 860 | 860 | added: v0.1.16 | |
| 861 | 861 | --> | |
@@ -864,7 +864,7 @@ added: v0.1.16 | |||
| 864 | 864 | ||
| 865 | 865 | The fully resolved filename of the module. | |
| 866 | 866 | ||
| 867 | - ### module.id | ||
| 867 | + ### `module.id` | ||
| 868 | 868 | <!-- YAML | |
| 869 | 869 | added: v0.1.16 | |
| 870 | 870 | --> | |
@@ -874,7 +874,7 @@ added: v0.1.16 | |||
| 874 | 874 | The identifier for the module. Typically this is the fully resolved | |
| 875 | 875 | filename. | |
| 876 | 876 | ||
| 877 | - ### module.loaded | ||
| 877 | + ### `module.loaded` | ||
| 878 | 878 | <!-- YAML | |
| 879 | 879 | added: v0.1.16 | |
| 880 | 880 | --> | |
@@ -884,7 +884,7 @@ added: v0.1.16 | |||
| 884 | 884 | Whether or not the module is done loading, or is in the process of | |
| 885 | 885 | loading. | |
| 886 | 886 | ||
| 887 | - ### module.parent | ||
| 887 | + ### `module.parent` | ||
| 888 | 888 | <!-- YAML | |
| 889 | 889 | added: v0.1.16 | |
| 890 | 890 | --> | |
@@ -893,7 +893,7 @@ added: v0.1.16 | |||
| 893 | 893 | ||
| 894 | 894 | The module that first required this one. | |
| 895 | 895 | ||
| 896 | - ### module.paths | ||
| 896 | + ### `module.paths` | ||
| 897 | 897 | <!-- YAML | |
| 898 | 898 | added: v0.4.0 | |
| 899 | 899 | --> | |
@@ -902,7 +902,7 @@ added: v0.4.0 | |||
| 902 | 902 | ||
| 903 | 903 | The search paths for the module. | |
| 904 | 904 | ||
| 905 | - ### module.require(id) | ||
| 905 | + ### `module.require(id)` | ||
| 906 | 906 | <!-- YAML | |
| 907 | 907 | added: v0.5.1 | |
| 908 | 908 | --> | |
@@ -930,7 +930,7 @@ Provides general utility methods when interacting with instances of | |||
| 930 | 930 | `Module` — the `module` variable often seen in file modules. Accessed | |
| 931 | 931 | via `require('module')`. | |
| 932 | 932 | ||
| 933 | - ### module.builtinModules | ||
| 933 | + ### `module.builtinModules` | ||
| 934 | 934 | <!-- YAML | |
| 935 | 935 | added: | |
| 936 | 936 | - v9.3.0 | |
@@ -950,7 +950,7 @@ by the [module wrapper][]. To access it, require the `Module` module: | |||
| 950 | 950 | const builtin = require('module').builtinModules; | |
| 951 | 951 | ``` | |
| 952 | 952 | ||
| 953 | - ### module.createRequire(filename) | ||
| 953 | + ### `module.createRequire(filename)` | ||
| 954 | 954 | <!-- YAML | |
| 955 | 955 | added: v12.2.0 | |
| 956 | 956 | --> | |
@@ -968,7 +968,7 @@ const require = createRequire(import.meta.url); | |||
| 968 | 968 | const siblingModule = require('./sibling-module'); | |
| 969 | 969 | ``` | |
| 970 | 970 | ||
| 971 | - ### module.createRequireFromPath(filename) | ||
| 971 | + ### `module.createRequireFromPath(filename)` | ||
| 972 | 972 | <!-- YAML | |
| 973 | 973 | added: v10.12.0 | |
| 974 | 974 | deprecated: v12.2.0 | |
@@ -988,7 +988,7 @@ const requireUtil = createRequireFromPath('../src/utils/'); | |||
| 988 | 988 | requireUtil('./some-tool'); | |
| 989 | 989 | ``` | |
| 990 | 990 | ||
| 991 | - ### module.syncBuiltinESMExports() | ||
| 991 | + ### `module.syncBuiltinESMExports()` | ||
| 992 | 992 | <!-- YAML | |
| 993 | 993 | added: v12.12.0 | |
| 994 | 994 | --> | |
| Back | FazBrowse Home | New Git URL |
0 commit comments