Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Automatic365/e94f9702f8ad7f26b28b3ae0233f6f6e to your computer and use it in GitHub Desktop.
Save Automatic365/e94f9702f8ad7f26b28b3ae0233f6f6e 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?
    • A chunk of code that can be shared (required) between files by using module.exports at the end of the file you want to expose and require('path/to/file') in the file that you want to import the module to.
    • The code examples from the second blog post look very different from the first. Why?
      • The first post is using node to export modules, whereas the second post using RequireJS.

Additional Resources

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