Skip to content

Instantly share code, notes, and snippets.

@pindell-matt
Forked from rrgayhart/require-1602.markdown
Last active July 19, 2016 04:25
Show Gist options
  • Save pindell-matt/dfe2fbe020c67ac27d7b8964db9cc25c to your computer and use it in GitHub Desktop.
Save pindell-matt/dfe2fbe020c67ac27d7b8964db9cc25c to your computer and use it in GitHub Desktop.
The Concept of Require

Materials: Node.js, Require and Exports and Organize Your Code with RequireJS

Questions:

  • Q: In the context of Node, what is a module?

  • A: Modules are essentially a tool for organizing your code into digestible pieces that function similar to classes in Ruby, albeit a tad more precise - as you choose exactly the function from the module that you'd like to export - a.k.a. make available to other parts of your program.

  • Q: The code examples from the second blog post look very different from the first. Why?

  • A: The second article doesn't use Node.

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