Length | Points | Week |
---|---|---|
20 minutes | 10 | Week 2 |
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
- Fork This Gist
- Respond in your forked gist with answers to the following questions
-
In the context of Node, what is a
module
?In the context of Node, a module is mapped to a file, so each file is its own module, and
require
is used to link modules together. -
The code examples from the second blog post look very different from the first. Why?
the second blog post is using requires in the RequireJS framework, so they look a bit different. that said, unless this is a super common framework to use, I don't really see the point.
module.exports
andrequire
work just fine for me.
-