Skip to main content

TIL: Modules | Node.js v10.2.1 Documentation

This always gave me headaches .... clear case of RTFM ... m)

Modules are cached after the first time they are loaded. This means (among other things) that every call to require('foo') will get exactly the same object returned, if it would resolve to the same file.