Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ryanflach/f24dbec4d52098fd7af7ada2907726ff to your computer and use it in GitHub Desktop.
Save ryanflach/f24dbec4d52098fd7af7ada2907726ff to your computer and use it in GitHub Desktop.
  • In the context of Node, what is a module?
    • A chunk of code that can be shared (required) between files, much like classes and modules can be shared between files in Ruby. There is no syntax required when creating what may become a module. Instead, use of module.exports at the end of a file determines what code is available when using var access = require('path/to/file') in another file that may need it.
  • The code examples from the second blog post look very different from the first. Why?
    • The first is using the syntax from node to export modules, whereas the second is using a file and module loader called RequireJS.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment