Skip to content

Instantly share code, notes, and snippets.

@sekharp
Forked from rrgayhart/require.markdown
Last active February 16, 2016 22:13
Show Gist options
  • Save sekharp/10658c36e0bf828c4aec to your computer and use it in GitHub Desktop.
Save sekharp/10658c36e0bf828c4aec 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? A module is the fundamental building block of node which maps directly to a file. A module can be a container of exported values or not.
  • The code examples from the second blog post look very different from the first. Why? The second blog post uses RequireJS and thus has different syntax that pulls in and simplifies much of the work of doing module.exports.
@rrgayhart
Copy link

👍

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