CommonJS是一种规范,是一种模块化的规范。它有一个全局方法require(),用于加载模块。
var math =require('math'); math.add(2,3);//5
CommonJS 定义的模块分为:{模块引用(require)}{模块定义(exports)} {模块标识(module)}
require()用来引入外部模块;exports 对象用于当前模块的方法或变量,唯一的dao'chu'kou