From 6f39f105435ffd5e71ece41266ef3c256b29dc88 Mon Sep 17 00:00:00 2001 From: Alex Zherdev Date: Fri, 11 Oct 2019 16:01:34 -0700 Subject: [PATCH] doc: fix an error in resolution algorithm steps As it is, if `X begins with './' or '/' or '../'` (step 3), it reads as if it were possible for the algorithm to do a node_modules lookup (step 4). But that doesn't seem to reflect the actual logic. PR-URL: https://github.com/nodejs/node/pull/29940 Reviewed-By: Ben Noordhuis Reviewed-By: Jan Krems Reviewed-By: Ruben Bridgewater Reviewed-By: Anto Aravinth Reviewed-By: James M Snell --- doc/api/modules.md | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/api/modules.md b/doc/api/modules.md index 9bf02ff0bbf4b1..8715218b32c8a4 100644 --- a/doc/api/modules.md +++ b/doc/api/modules.md @@ -159,6 +159,7 @@ require(X) from module at path Y 3. If X begins with './' or '/' or '../' a. LOAD_AS_FILE(Y + X) b. LOAD_AS_DIRECTORY(Y + X) + c. THROW "not found" 4. LOAD_NODE_MODULES(X, dirname(Y)) 5. LOAD_SELF_REFERENCE(X, dirname(Y)) 6. THROW "not found"