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
? A module is basically just a file that holds variabls and function that you may want access to throughout your program, or maybe even just more than one file. -
The code examples from the second blog post look very different from the first. Why? Because in the second one they are defining their own modules, whereas in the first one, node seems to be doing this for us by automatically turning them into seperate files.
👍