【发布时间】:2018-08-11 15:22:48
【问题描述】:
假设我的 Node.Js 应用程序的 validate.js 中有以下 exports 函数:
exports.stopwordsClean = function () {
return function(req, res, next){
console.log("validating...");
}
};
我知道要从另一个文件中引用这个函数,我会先require这个文件然后使用validate.stopwordsClean()
但是我如何从同一个文件中引用它呢? this.stopwordsClean() 不起作用...
【问题讨论】:
-
你想在哪里使用它?请把代码贴在你想调用
stopwardsClean()方法的地方
标签: javascript node.js include