Uh oh!
There was an error while loading. Please reload this page.
doc: include global node_modules in require.resolve description - #20534
doc: include global node_modules in require.resolve description#20534musgravejw wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
Nit: ~/.node_modules -> `~/.node_modules`?
There was a problem hiding this comment.
(If so, this line will need rewrapping at 80 characters.)
BridgeAR
commented
May 5, 2018
LGTM with the comments addressed. |
richardlau
commented
May 5, 2018
Looks like GitHub's web interface no longer fully works on IOS 10 so I can't properly review this to request changes. Please could you rename cc @nodejs/modules |
musgravejw
commented
May 5, 2018
Updated. |
vsemozhetbyt
commented
May 5, 2018
Node.js Collaborators, please, add 👍 here if you approve fast-tracking. |
vsemozhetbyt
commented
May 5, 2018
| 1. let PARTS = path split(START) | ||
| 2. let I = count of PARTS - 1 | ||
| 3. let DIRS = [] | ||
| 3. let DIRS = [ GLOBAL_FOLDERS ] |
There was a problem hiding this comment.
The term “GLOBAL_FOLDERS” doesn’t appear to be defined anywhere; if you mean the list in line 424, could you alter that list as well to use this identical term?
Ideally, this term would also link down to that section.
There was a problem hiding this comment.
@ljharb What would be the best way to capture this? The main heading is regarding "loading from the global folders." Would it make sense to say Additionally, Node.js will search in the following global folders:?
There was a problem hiding this comment.
Even just a sentence in the below section like “This list of GLOBAL_FOLDERS:” or something
There was a problem hiding this comment.
It’d be cool if the mention in the algorithm itself could also be linked.
vsemozhetbyt
commented
May 7, 2018
| 1. let PARTS = path split(START) | ||
| 2. let I = count of PARTS - 1 | ||
| 3. let DIRS = [] | ||
| 3. let DIRS = [GLOBAL_FOLDERS](#modules_loading_from_the_global_folders) |
There was a problem hiding this comment.
Will this link render on the website? On github it's not.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Sorry, I misunderstood the note.
| meaning that the `node_modules` hierarchy is checked from this location. | ||
| paths are used instead of the default resolution paths, with the exception | ||
| of [GLOBAL_FOLDERS](#modules_loading_from_the_global_folders) like | ||
| `~/.node_modules`, which are always included. Note that each of these paths |
There was a problem hiding this comment.
$HOME/.node_modules should be preferred, tild is from bash.
There was a problem hiding this comment.
$HOME/.node_modules would also be consistent with the list in the Loading from the global folders section.
| these paths is used as a starting point for the module resolution algorithm, | ||
| meaning that the `node_modules` hierarchy is checked from this location. | ||
| paths are used instead of the default resolution paths, with the exception | ||
| of [GLOBAL_FOLDERS](#modules_loading_from_the_global_folders) like |
There was a problem hiding this comment.
Since the link #modules_loading_from_the_global_folders is used twice in the document, it can be moved to bottom of the page as follows:
vsemozhetbyt
commented
May 8, 2018
This comment has been minimized.
This comment has been minimized.
richardlau
commented
May 8, 2018
@xtuc's comment still stands, the change doesn't render as a link in GitHub: https://github.com/musgravejw/node/blob/4b6bf5cca73c211007d99344522fb91c6b9668bf/doc/api/modules.md#all-together |
ljharb
commented
May 8, 2018
Since it's in a preformatted block, I don't think that's possible. Either way, as long as I can "find in page" for "GLOBAL_FOLDERS", it's good, and i think i'd personally rather have the website be more usable with a link than have the markdown be less messy by omitting the link. |
vsemozhetbyt
commented
May 8, 2018
Yes, sorry, I'missed that this is a code block. |
trivikr
commented
May 9, 2018
@vsemozhetbyt#20534 (review) is not addressed yet |
vsemozhetbyt
commented
May 9, 2018
|
| `~/.node_modules`, which are always included. Note that each of these paths | ||
| is used as a starting point for the module resolution algorithm, meaning | ||
| that the `node_modules` hierarchy is checked from this location. | ||
| of [GLOBAL_FOLDERS][] like `$HOME/.node_modules`, which are always |
There was a problem hiding this comment.
Nit: trailing space, but this can be fixed on landing)
vsemozhetbyt
commented
May 9, 2018
| 1. let PARTS = path split(START) | ||
| 2. let I = count of PARTS - 1 | ||
| 3. let DIRS = [] | ||
| 3. let DIRS = [GLOBAL_FOLDERS] |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
vsemozhetbyt
commented
May 11, 2018
Landed in 6fd8022 (with a tiny fix: insert bottom reference in ASCII sort order). Thank you! |

Closes: #18926
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes