> For the complete documentation index, see [llms.txt](https://sekin.gitbook.io/myjs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sekin.gitbook.io/myjs/mo-kuai-hua-bian-cheng/cmdmo-kuai.md).

# CMD模块

## 原文地址：<http://annn.me/how-to-realize-cmd-loader/>

## CMD(SeaJS)

玉伯提出的CMD规范，并开发了前端模块化开发框架SeaJS，不过在2015年后SeaJS停止了在github上维护，CMD与AMD用法很相似。

他的模块的定义(define)和引入（require），与CMD有点不一样，和CommonjS的引入类似，传入了exports、module、require参数。

```javascript
define(functin(exports,module,require){

  var $ =  require("./lib/jquery.js"); // 引入模块


   var a = "1";

   var fun1 = function (){

     return 23;
   }

   exports.a = a; //导出模块变量，提供接口
   // 或 
   module.exports.fun1 =fun1;


})
```

模块
