Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save zackforbing/b8500d4d277a7a969e9d615b052f5e0b to your computer and use it in GitHub Desktop.
Save zackforbing/b8500d4d277a7a969e9d615b052f5e0b to your computer and use it in GitHub Desktop.
Length Points Week
20 minutes 10 Week 2

The Concept of Require - Research

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.

Deliverable

  • 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 and require work just fine for me.

Additional Resources

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment