Skip to content

How to structure overview

Tim Branyen edited this page Nov 13, 2013 · 4 revisions

Modules are a relatively abstract term that can be boiled down to a specific end: when requested, will return an object. This object can contain whatever you want and will always be the exact same reference no matter where it's requested.

This method of coding has a lot of immediate benefits:

  • Dependency tracking to only build what you use.
  • Easy integration with existing popular web frameworks.
  • Only expose what you want others to consume.
  • Test files independently.

Long term benefits are often:

  • A more readable and maintainable codebase.
  • A consistently optimized release file size.
  • Encouraging files to serve a specific purpose instead of conflation.