@@ -175,15 +175,15 @@ LOAD_AS_DIRECTORY(X)
175
175
2. LOAD_INDEX(X)
176
176
177
177
LOAD_NODE_MODULES(X, START)
178
- 1. let DIRS= NODE_MODULES_PATHS(START)
178
+ 1. let DIRS = NODE_MODULES_PATHS(START)
179
179
2. for each DIR in DIRS:
180
180
a. LOAD_AS_FILE(DIR/X)
181
181
b. LOAD_AS_DIRECTORY(DIR/X)
182
182
183
183
NODE_MODULES_PATHS(START)
184
184
1. let PARTS = path split(START)
185
185
2. let I = count of PARTS - 1
186
- 3. let DIRS = []
186
+ 3. let DIRS = [ GLOBAL_FOLDERS ]
187
187
4. while I >= 0,
188
188
a. if PARTS[I] = "node_modules" CONTINUE
189
189
b. DIR = path join(PARTS[0 .. I] + "node_modules")
@@ -649,9 +649,11 @@ changes:
649
649
* ` request ` {string} The module path to resolve.
650
650
* ` options ` {Object}
651
651
* ` paths ` {string[ ] } Paths to resolve module location from. If present, these
652
- paths are used instead of the default resolution paths. Note that each of
653
- these paths is used as a starting point for the module resolution algorithm,
654
- meaning that the ` node_modules ` hierarchy is checked from this location.
652
+ paths are used instead of the default resolution paths, with the exception
653
+ of global folders like ` ~/.node_modules ` , which are always included. Note
654
+ that each of these paths is used as a starting point for the module
655
+ resolution algorithm, meaning that the ` node_modules ` hierarchy is checked
656
+ from this location.
655
657
* Returns: {string}
656
658
657
659
Use the internal ` require() ` machinery to look up the location of a module,
0 commit comments