The pseudocode in the All Together section lists this as the final step for LOAD_AS_DIRECTORY(X):
LOAD_AS_FILE(X) then has the following steps:
However, X/index (without an extension) is never actually attempted – Node skips straight to X/index.js. I found this misleading, as I expected e.g. require('./path/to/dir') to attempt a file named simply index first (./path/to/dir/index).
(The other documentation for Folder Modules is fine and clearly states that index.js and index.node are attempted.)
Oh, I see. Yeah, it says that there's a LOAD_AS_FILE(X/index) when really it just tries X/index.js and X/index.node.
Doc correction coming.
Fix #1851 Correct X/index doc