Node.js:在同一模块中调用另一个导出的函数

我正在写一个node.js模块,导出两个函数,我想调用另一个函数,但我看到一个未定义的引用错误。

有没有这样的模式? 我只是做一个私人的function,并包装它?

以下是一些示例代码:

(function() { "use strict"; module.exports = function (params) { return { funcA: function() { console.log('funcA'); }, funcB: function() { funcA(); // ReferenceError: funcA is not defined } } } }()); 

我喜欢这种方式:

 (function() { "use strict"; module.exports = function (params) { var methods = {}; methods.funcA = function() { console.log('funcA'); }; methods.funcB = function() { methods.funcA(); }; return methods; }; }());