require()

每个模块实例都有一个require方法

Module.prototype.require = function(path){

return Module._load(path,this);

}

由此可知,require并不是全局性命令,而是每个模块提供的一个内部方法。

posted @ 2016-09-25 13:08  全圈圈圈  阅读(125)  评论(0编辑  收藏  举报