Quiz Challenges
100
Question 81 of 100
81%
81
When require('./utils') is called and ./utils is a directory (not a file), in what order does Node.js typically resolve it?
A
It first tries ./utils.js, then ./utils.json, then ./utils.node as files; only if none of those exist does it look inside the utils/ directory, checking package.json's "main" field and falling back to utils/index.js
B
It searches node_modules for a package literally named utils before checking anything at the local relative path
C
It only ever looks for utils/index.js directly, and throws immediately if that file is missing
D
require() requires an explicit file extension in every case; require('./utils') without one always throws a MODULE_NOT_FOUND error
Submit Answer
Previous
81
/
100
Next