您可以执行以下操作:
module.exports = { method: function() {}, otherMethod: function() {},};要不就:
exports.method = function() {};exports.otherMethod = function() {};然后在调用脚本中:
const myModule = require('./myModule.js');const method = myModule.method;const otherMethod = myModule.otherMethod;// OR:const {method, otherMethod} = require('./myModule.js');


