# 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(){
});
```
