Materials: Node.js, Require and Exports and Organize Your Code with RequireJS
-
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.