Skip to content

Instantly share code, notes, and snippets.

@cheljoh
Forked from rrgayhart/require-1511.markdown
Last active May 20, 2016 15:29
Show Gist options
  • Save cheljoh/4e726071895e7880e54d1705654a8f3d to your computer and use it in GitHub Desktop.
Save cheljoh/4e726071895e7880e54d1705654a8f3d to your computer and use it in GitHub Desktop.
The Concept of Require

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 and answer the following questions:

  • In the context of Node, what is a module?
  • It's a building block that maps to a file. Load it by using 'require,' export it by using module.exports.
  • The code examples from the second blog post look very different from the first. Why?
  • The second blog post uses a library RequireJS.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment