
The CommonJS format is used in Node.js and uses require and module.exports to define dependencies and modules.
CommonJS modules were designed with server development in mind. Naturally, the API is synchronous. In other words, modules are loaded at the moment and in the order they are required inside a source file.
The AMD format is used in browsers and uses a define function to define modules.
The main difference between AMD and CommonJS lies in its support for asynchronous module loading. Asynchronous loading is made possible by using JavaScript's traditional closure idiom: a function is called when the requested modules are finished loading. Module definitions and importing a module is carried by the same function: when a module is defined its dependencies are made explicit.