> For the complete documentation index, see [llms.txt](https://bharat-tiwari.gitbook.io/our-tech-journal/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://bharat-tiwari.gitbook.io/our-tech-journal/javascript/module-patterns-in-js-commonjs-amd-and-es6-classes.md).

# Module Patterns in JS - CommonJS, AMD and ES6 classes

{% embed url="<https://2ality.com/2014/09/es6-modules-final.html?utm_source=javascriptweekly&utm_medium=email>" %}

* IIFE pattern
* Module Patterns (Common JS, AMD pattern)
* ES6 Classes

## Quick Scribblings

**CommonJS** = is a specification for a module format/pattern in javascript where dependencies between two modules is defined or established using the keywords 'exports' and 'require' .&#x20;

**SystemJS** & **RequireJS** are module loaders that are built using the implementation of few module pattern specifications including **CommonJS** (they also support other module formats like AMD and ES6)

AMD (Asynchronous Module Dependency)  Pattern

```javascript
let myModule = new module( [module1, module2], function(){
});
```
