Home Javascript, module.exports in chapter 10 of "Eloquent Javascript"

# Javascript, module.exports in chapter 10 of "Eloquent Javascript"

 Here is the code:  function require(name) { if (name in require.cache) return require.cache[name]; var code = new Function("exports, module", readFile(name)); var exports = {}, module = {exports: exports}; code(exports, module); require.cache[name] = module.exports; return module.exports; } require.cache = Object.create(null);  What is the role of this require.cache object? And why can't exports variable hold a function, for example? Because the author of the book tells us that we can not export a function, for example, into this variable. As far as I can see, bot export and module.export will (and actually can) hold the same kind of data. Thank you!