- In the context of Node, what is a
module
?
A module is a fundamental Node building block that maps to a file. To expose the objects or methods contained in the module, i.e. another file, requires using module.exports
in the module for anything that should be exposed, and to require
the exported things in the file that wants to use them.
- The code examples from the second blog post look very different from the first. Why?
I really hope it's because the second blog post is using RequireJS and all that syntax is sugar created by RequireJS in order to associate things inside the module with variables in other files.