diff --git a/doc/api/modules.md b/doc/api/modules.md index 0730cc119717e3..bd975d273e2366 100644 --- a/doc/api/modules.md +++ b/doc/api/modules.md @@ -197,13 +197,13 @@ LOAD_NODE_MODULES(X, START) NODE_MODULES_PATHS(START) 1. let PARTS = path split(START) 2. let I = count of PARTS - 1 -3. let DIRS = [GLOBAL_FOLDERS] +3. let DIRS = [] 4. while I >= 0, a. if PARTS[I] = "node_modules" CONTINUE b. DIR = path join(PARTS[0 .. I] + "node_modules") - c. DIRS = DIRS + DIR + c. DIRS = DIR + DIRS d. let I = I - 1 -5. return DIRS +5. return DIRS + GLOBAL_FOLDERS LOAD_PACKAGE_IMPORTS(X, DIR) 1. Find the closest package scope SCOPE to DIR.