The following pattern is surprisingly common in JavaScript: A library is a single function, but additional services are provided via properties of that function. Functions, variables, and classes are exposed using the export keyword. Hybrid Exports Only 1 global variable is introduced, which is the module name (or namespace). How I can dynamically import Python module? Hi i just learnt about the module pattern using IFFE and closures so that you don’t pollute the global namespace and encapsulate method and variables inside the iffe. In other words, one can create a single module concentrating various exports from various modules. Thanks for contributing an answer to Stack Overflow! Two years ago I wrote about a technique—now commonly referred to as the module/nomodule pattern—that allows you to write ES2015+ JavaScript and then use bundlers and transpilers to generate two versions of your codebase, one with modern syntax (loaded via