嗨,这是我在节点js文件中的方法:
exports.start = function() {
console.log(' in start of sender.js');
});
Run Code Online (Sandbox Code Playgroud)
如何在同一个js文件中调用此方法?我试过调用start()和exports.start()但没有成功.
mic*_*nic 49
使用此代码:
var start = exports.start = function() {
console.log(' in start of sender.js');
});
Run Code Online (Sandbox Code Playgroud)
要么
function start() {
console.log(' in start of sender.js');
});
exports.start = start;
//you can call start();
Run Code Online (Sandbox Code Playgroud)
Ash*_*Jha 21
exports.start = function(){
console.log('testing...')
}
Run Code Online (Sandbox Code Playgroud)
您可以像这样调用此方法
exports.start();
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
15698 次 |
最近记录: |