Skip to content

Instantly share code, notes, and snippets.

@tjkomor
Forked from rrgayhart/require.markdown
Last active February 9, 2016 20:40
Show Gist options
  • Save tjkomor/c76c8c8f5970a7aa2c70 to your computer and use it in GitHub Desktop.
Save tjkomor/c76c8c8f5970a7aa2c70 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 basically just a file that holds variabls and function that you may want access to throughout your program, or maybe even just more than one file.

  • The code examples from the second blog post look very different from the first. Why? Because in the second one they are defining their own modules, whereas in the first one, node seems to be doing this for us by automatically turning them into seperate files.

@rrgayhart
Copy link

👍

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