When you start working with WebPack for GameTime, you'll notice that you can't just define a variable in one file and find it in another as easily as you can in Rails.
Read Node.js, Require and Exports and Organize Your Code with RequireJS
- In the context of Node, what is a
module
? - The code examples from the second blog post look very different from the first. Why?
In Node, a module maps to code in a specific file. It feels like a way to create namespaces.
The second blog post uses a module loader called RequireJS. RequireJS has specific syntax associated with it. It does not seem really obvious to me that Node doesn't have the same functionality.