Javascript modules have been around for a while, and there are plenty of good reasons why to use them, instead of writing code directly in the global scope.
However, you might find yourself working on a legacy piece of code that was written without taking modules into account and considering what to do to start refactoring it into a module based pattern, like AMD or CommonJS. Well, that was my case.
What I wanted to do was to take a big, monolithic library and break it incrementally into smaller modules. So the initial idea was to take a few functions, wrap them in a module, load the module back into the global scope and expose the module functions back through the library as to avoid breaking changes for its consumers.