This is a post for those, who feels that Sprockets is not enough to structure his JS in a Rails app. If you’re not satisfied with #= require and window.Global mess, come under the cut.
CommonJS modules are a way of encapsulating and packaging up JavaScript files to ensure they’re name-spaced and loosely coupled, a crucial aspect to ensuring JavaScript code quality and maintainability.